Chromium Code Reviews| Index: src/core/SkMatrix.cpp |
| diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp |
| index 0fd802087fc0c5f52e6da2be56edbfb1b9fcc442..fb8b89e9f1feddd0a25fc2f21e38faaa69e10c79 100644 |
| --- a/src/core/SkMatrix.cpp |
| +++ b/src/core/SkMatrix.cpp |
| @@ -290,7 +290,11 @@ void SkMatrix::preTranslate(SkScalar dx, SkScalar dy) { |
| return; |
| } |
| - if (this->hasPerspective()) { |
| + if (fTypeMask <= kTranslate_Mask) { |
| + fMat[kMTransX] += dx; |
| + fMat[kMTransY] += dy; |
| + this->setTypeMask(kTranslate_Mask); |
|
reed1
2016/08/18 21:22:20
I *think* we can assert that the matrix is mislabe
|
| + } else if (this->hasPerspective()) { |
| SkMatrix m; |
| m.setTranslate(dx, dy); |
| this->preConcat(m); |
| @@ -1100,7 +1104,7 @@ void SkMatrix::mapVectors(SkPoint dst[], const SkPoint src[], int count) const { |
| void SkMatrix::mapRectScaleTranslate(SkRect* dst, const SkRect& src) const { |
| SkASSERT(dst); |
| SkASSERT(this->isScaleTranslate()); |
| - |
| + |
| SkScalar sx = fMat[kMScaleX]; |
| SkScalar sy = fMat[kMScaleY]; |
| SkScalar tx = fMat[kMTransX]; |