From d965bc5823d878a3fd056b8a95fb4eb578ed3fe4 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Mon, 16 Sep 2013 14:47:13 -0700 Subject: Disallow negative scale matrices in merged Bitmap drawing bug:10622962 Change-Id: I55ac18ad56b53dc9e6e6ea14cd3ec4bdafa98ac3 --- libs/hwui/Matrix.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/hwui/Matrix.cpp') 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); } -- cgit v1.2.3-59-g8ed1b