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

Unified Diff: include/utils/SkMatrix44.h

Issue 676583002: Add isScale2d() helper function to SkMatrix44. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: isScale() Created 6 years, 2 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: include/utils/SkMatrix44.h
diff --git a/include/utils/SkMatrix44.h b/include/utils/SkMatrix44.h
index 553e8d7c4f9d0551e73f4bf97368b6d29e6b2d83..90f29a994a77eeb480500c6e1345ae1a76e7aeaf 100644
--- a/include/utils/SkMatrix44.h
+++ b/include/utils/SkMatrix44.h
@@ -225,6 +225,13 @@ public:
return !(this->getType() & ~(kScale_Mask | kTranslate_Mask));
}
+ /**
+ * Returns true if the matrix only contains scale or is identity.
+ */
+ inline bool isScale() const {
+ return !(this->getType() & ~kScale_Mask);
+ }
+
inline bool hasPerspective() const {
return SkToBool(this->getType() & kPerspective_Mask);
}
« 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