Index: src/core/SkMatrix.cpp |
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp |
index 0fd802087fc0c5f52e6da2be56edbfb1b9fcc442..96ad8a093ec1b94bfc18355278a58d31c228c84a 100644 |
--- a/src/core/SkMatrix.cpp |
+++ b/src/core/SkMatrix.cpp |
@@ -290,7 +290,12 @@ void SkMatrix::preTranslate(SkScalar dx, SkScalar dy) { |
return; |
} |
- if (this->hasPerspective()) { |
+ if (fTypeMask == kTranslate_Mask) { |
+ fMat[kMTransX] += dx; |
+ fMat[kMTransY] += dy; |
+ // Translate x Translate == Translate |
+ SkASSERT(kTranslate_Mask == this->computeTypeMask()); |
reed1
2016/08/18 19:28:18
This could fail if the translate sent those fields
mtklein_C
2016/08/18 19:35:59
Good catch. Fixed.
|
+ } else if (this->hasPerspective()) { |
SkMatrix m; |
m.setTranslate(dx, dy); |
this->preConcat(m); |