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

Unified Diff: ui/gfx/transform.h

Issue 687873004: Introduce Property Trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wip-awoloszyn2
Patch Set: . Created 6 years 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
« cc/trees/property_tree_builder.cc ('K') | « cc/trees/property_tree_unittest.cc ('k') | 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 7bba73dbe0c04c260697dc215dbd7ebca869f436..d984202e0873c58c227a3015e76cb55467116d8f 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -122,6 +122,11 @@ class GFX_EXPORT Transform {
// Returns true if the matrix is either identity or pure translation.
bool IsIdentityOrTranslation() const { return matrix_.isTranslate(); }
+ // Returns true if the matrix is either the identity or a 2d translation.
+ bool IsIdentityOr2DTranslation() const {
+ return matrix_.isTranslate() && matrix_.get(2, 3) == 0;
+ }
+
// Returns true if the matrix is either identity or pure translation,
// allowing for an amount of inaccuracy as specified by the parameter.
bool IsApproximatelyIdentityOrTranslation(SkMScalar tolerance) const;
« cc/trees/property_tree_builder.cc ('K') | « cc/trees/property_tree_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698