diff options
Diffstat (limited to 'libs/hwui/Matrix.cpp')
-rw-r--r-- | libs/hwui/Matrix.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp index 6a5ea51..ba22071 100644 --- a/libs/hwui/Matrix.cpp +++ b/libs/hwui/Matrix.cpp @@ -72,7 +72,7 @@ static bool isZero(float f) { return fabs(f) <= EPSILON; } -uint32_t Matrix4::getType() const { +uint8_t Matrix4::getType() const { if (mType & kTypeUnknown) { mType = kTypeIdentity; @@ -114,7 +114,7 @@ uint32_t Matrix4::getType() const { return mType; } -uint32_t Matrix4::getGeometryType() const { +uint8_t Matrix4::getGeometryType() const { return getType() & sGeometryMask; } @@ -122,12 +122,16 @@ bool Matrix4::rectToRect() const { return getType() & kTypeRectToRect; } +bool Matrix4::positiveScale() const { + return (data[kScaleX] > 0.0f && data[kScaleY] > 0.0f); +} + bool Matrix4::changesBounds() const { return getType() & (kTypeScale | kTypeAffine | kTypePerspective); } bool Matrix4::isPureTranslate() const { - return getGeometryType() == kTypeTranslate; + return getGeometryType() <= kTypeTranslate; } bool Matrix4::isSimple() const { |