MCPcopy Create free account
hub / github.com/Tencent/tgfx / updateMatrix

Method updateMatrix

src/pdf/PDFGraphicStackState.cpp:82–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82void PDFGraphicStackState::updateMatrix(const Matrix& matrix) {
83 if (matrix == currentEntry()->matrix) {
84 return;
85 }
86
87 if (!currentEntry()->matrix.isIdentity()) {
88 DEBUG_ASSERT(stackDepth > 0);
89 const auto& currentState = entries[stackDepth].state;
90 const auto& previousState = entries[stackDepth - 1].state;
91
92 ASSERT(currentState.clip.isSame(previousState.clip) &&
93 currentState.matrix == previousState.matrix);
94 pop();
95 DEBUG_ASSERT(currentEntry()->matrix.isIdentity());
96 }
97
98 if (matrix.isIdentity()) {
99 return;
100 }
101
102 push();
103 PDFUtils::AppendTransform(matrix, contentStream);
104 currentEntry()->matrix = matrix;
105}
106
107void PDFGraphicStackState::updateDrawingState(const PDFGraphicStackState::Entry& state) {
108 // PDF treats a shader as a color, so we only set one or the other.

Callers 1

setUpContentEntryMethod · 0.80

Calls 2

isIdentityMethod · 0.80
isSameMethod · 0.80

Tested by

no test coverage detected