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

Unified Diff: src/core/SkCanvas.cpp

Issue 2331943002: check for identity in translate (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 6e898fa1bbb73fdae8b73e7b4241979cf6376b3c..e53a104c47fa28406f1d440dbcd670365d877a24 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1457,14 +1457,16 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y, const SkPa
/////////////////////////////////////////////////////////////////////////////
void SkCanvas::translate(SkScalar dx, SkScalar dy) {
- this->checkForDeferredSave();
- fDeviceCMDirty = true;
- fMCRec->fMatrix.preTranslate(dx,dy);
+ if (dx || dy) {
+ this->checkForDeferredSave();
+ fDeviceCMDirty = true;
+ fMCRec->fMatrix.preTranslate(dx,dy);
- // Translate shouldn't affect the is-scale-translateness of the matrix.
- SkASSERT(fIsScaleTranslate == fMCRec->fMatrix.isScaleTranslate());
+ // Translate shouldn't affect the is-scale-translateness of the matrix.
+ SkASSERT(fIsScaleTranslate == fMCRec->fMatrix.isScaleTranslate());
- this->didTranslate(dx,dy);
+ this->didTranslate(dx,dy);
+ }
}
void SkCanvas::scale(SkScalar sx, SkScalar sy) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698