Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(900)

Unified Diff: ui/gfx/transform.h

Issue 590553002: gfx: Use SkMatrix44 helpers instead of accessing its bitflags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/transform.h
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 96104fee4a6ebc3a25a0a33787bb82e9970cd737..6028fb37b4328ff677e05669bc331819c65e4947 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); }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698