aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-05 23:14:07 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-05 23:14:07 +0000
commitb4c2819671757044857ec477156699163025a353 (patch)
tree3352703deb1f1e4499d2b2e1184a4cbaec83ccf7 /src/core
parentf2e93fc989129f11881919de99a3b8f12081beae (diff)
Record the initial matrix when we begin picture-playback, and concat with
that if we see a setMatrix command. In this way we can respect the caller's overall playback matrix environment. Review URL: https://codereview.appspot.com/6495092 git-svn-id: http://skia.googlecode.com/svn/trunk@5409 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkPicturePlayback.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index bcad6162c0..cf3484b028 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -561,6 +561,9 @@ void SkPicturePlayback::draw(SkCanvas& canvas) {
SkReader32 reader(fOpData->bytes(), fOpData->size());
TextContainer text;
+ // Record this, so we can concat w/ it if we encounter a setMatrix()
+ SkMatrix initialMatrix = canvas.getTotalMatrix();
+
while (!reader.eof()) {
switch (reader.readInt()) {
case CLIP_PATH: {
@@ -786,9 +789,11 @@ void SkPicturePlayback::draw(SkCanvas& canvas) {
SkScalar sy = reader.readScalar();
canvas.scale(sx, sy);
} break;
- case SET_MATRIX:
- canvas.setMatrix(*getMatrix(reader));
- break;
+ case SET_MATRIX: {
+ SkMatrix matrix;
+ matrix.setConcat(initialMatrix, *getMatrix(reader));
+ canvas.setMatrix(matrix);
+ } break;
case SKEW: {
SkScalar sx = reader.readScalar();
SkScalar sy = reader.readScalar();