summaryrefslogtreecommitdiff
path: root/libs/hwui/Matrix.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-09-16 14:47:13 -0700
committerChris Craik <ccraik@google.com>2013-09-16 18:19:55 -0700
commitd965bc5823d878a3fd056b8a95fb4eb578ed3fe4 (patch)
tree708968d03c9260b2cc3f3bcd5eea4355c3146f63 /libs/hwui/Matrix.cpp
parent0f3e1487b26a822697f70747290809081c2072cc (diff)
Disallow negative scale matrices in merged Bitmap drawing
bug:10622962 Change-Id: I55ac18ad56b53dc9e6e6ea14cd3ec4bdafa98ac3
Diffstat (limited to 'libs/hwui/Matrix.cpp')
-rw-r--r--libs/hwui/Matrix.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp
index 65e7eae49c2d..1948778ceb7c 100644
--- a/libs/hwui/Matrix.cpp
+++ b/libs/hwui/Matrix.cpp
@@ -110,6 +110,10 @@ uint8_t Matrix4::getType() const {
mType |= kTypeRectToRect;
}
}
+
+ if (m00 > 0.0f && m11 > 0.0f) {
+ mType |= kTypePositiveScale;
+ }
}
return mType;
}
@@ -122,6 +126,10 @@ bool Matrix4::rectToRect() const {
return getType() & kTypeRectToRect;
}
+bool Matrix4::positiveScale() const {
+ return getType() & kTypePositiveScale;
+}
+
bool Matrix4::changesBounds() const {
return getType() & (kTypeScale | kTypeAffine | kTypePerspective);
}