aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-12 14:35:48 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-12 14:35:48 +0000
commit97cd69ca23b27d88e08727366c29c1147eb564de (patch)
tree9cec63a3ee17a4dfa25d98f53b14e051ba58c3f0 /src
parente9c2f9ba9ef4d6b3d7d9178657cd18d743c6da8d (diff)
Fix matrix type in setRectToRect
Review URL: https://codereview.appspot.com/6655055 git-svn-id: http://skia.googlecode.com/svn/trunk@5913 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkMatrix.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index 51450faee7..4cd27e42ee 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -544,7 +544,14 @@ bool SkMatrix::setRectToRect(const SkRect& src, const SkRect& dst,
fMat[kMSkewX] = fMat[kMSkewY] =
fMat[kMPersp0] = fMat[kMPersp1] = 0;
- this->setTypeMask(kScale_Mask | kTranslate_Mask | kRectStaysRect_Mask);
+ unsigned mask = kRectStaysRect_Mask;
+ if (sx != SK_Scalar1 || sy != SK_Scalar1) {
+ mask |= kScale_Mask;
+ }
+ if (tx || ty) {
+ mask |= kTranslate_Mask;
+ }
+ this->setTypeMask(mask);
}
// shared cleanup
fMat[kMPersp2] = kMatrix22Elem;