summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2014-09-19 12:38:28 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-19 19:38:56 +0000
commit670a4abf8d79ed3d4071aa1f5cf775cf77a75a94 (patch)
treee33b4b8e8b342881edacd60cf3d90294bed48a9e
parenta66c92ff74876c9bd5a025a1bfa544956f0db94c (diff)
downloadchromium_src-670a4abf8d79ed3d4071aa1f5cf775cf77a75a94.zip
chromium_src-670a4abf8d79ed3d4071aa1f5cf775cf77a75a94.tar.gz
chromium_src-670a4abf8d79ed3d4071aa1f5cf775cf77a75a94.tar.bz2
gfx: Use SkMatrix44 helpers instead of accessing its bitflags.
IsIdentityOrTranslation, IsScaleOrTranslation, and HasPerspective are now provided by SkMatrix44 so use those. R=vollick BUG=408710 Review URL: https://codereview.chromium.org/590553002 Cr-Commit-Position: refs/heads/master@{#295766}
-rw-r--r--ui/gfx/transform.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 96104fe..6028fb3 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -120,9 +120,7 @@ class GFX_EXPORT Transform {
bool IsIdentity() const { return matrix_.isIdentity(); }
// Returns true if the matrix is either identity or pure translation.
- bool IsIdentityOrTranslation() const {
- return !(matrix_.getType() & ~SkMatrix44::kTranslate_Mask);
- }
+ bool IsIdentityOrTranslation() const { return matrix_.isTranslate(); }
// Returns true if the matrix is either identity or pure translation,
// allowing for an amount of inaccuracy as specified by the parameter.
@@ -146,10 +144,7 @@ class GFX_EXPORT Transform {
}
// Returns true if the matrix is has only scaling and translation components.
- bool IsScaleOrTranslation() const {
- int mask = SkMatrix44::kScale_Mask | SkMatrix44::kTranslate_Mask;
- return (matrix_.getType() & ~mask) == 0;
- }
+ bool IsScaleOrTranslation() const { return matrix_.isScaleTranslate(); }
// Returns true if axis-aligned 2d rects will remain axis-aligned after being
// transformed by this matrix.
@@ -157,9 +152,7 @@ class GFX_EXPORT Transform {
// Returns true if the matrix has any perspective component that would
// change the w-component of a homogeneous point.
- bool HasPerspective() const {
- return (matrix_.getType() & SkMatrix44::kPerspective_Mask) != 0;
- }
+ bool HasPerspective() const { return matrix_.hasPerspective(); }
// Returns true if this transform is non-singular.
bool IsInvertible() const { return matrix_.invert(NULL); }