| 80 | } |
| 81 | |
| 82 | void 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 | |
| 107 | void PDFGraphicStackState::updateDrawingState(const PDFGraphicStackState::Entry& state) { |
| 108 | // PDF treats a shader as a color, so we only set one or the other. |
no test coverage detected