Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1275)

Unified Diff: src/record/SkRecordDraw.cpp

Issue 290883004: Don't clobber initial transform with SetMatrix. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/record/SkRecordDraw.cpp
diff --git a/src/record/SkRecordDraw.cpp b/src/record/SkRecordDraw.cpp
index 324946e5d7a218364d3305b46606e5db652f01a3..3e0ac70b5a3216c03781504a1a474bdf2f421dc9 100644
--- a/src/record/SkRecordDraw.cpp
+++ b/src/record/SkRecordDraw.cpp
@@ -38,7 +38,13 @@ DRAW(PopCull, popCull());
DRAW(PushCull, pushCull(r.rect));
DRAW(Clear, clear(r.color));
DRAW(Concat, concat(r.matrix));
-DRAW(SetMatrix, setMatrix(r.matrix));
+
+// We can't clobber the canvas' initial CTM when calling setMatrix.
+template <> void Draw::draw(const SetMatrix& r) {
+ SkMatrix ctm = r.matrix;
+ ctm.postConcat(fInitialCTM);
reed1 2014/05/19 15:04:34 seems fine. NIT: Is it any more efficient to say:
mtklein 2014/05/19 15:11:23 Yes, I think that is a bit more efficient. Done.
+ fCanvas->setMatrix(ctm);
+}
DRAW(ClipPath, clipPath(r.path, r.op, r.doAA));
DRAW(ClipRRect, clipRRect(r.rrect, r.op, r.doAA));

Powered by Google App Engine
This is Rietveld 408576698