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) { |