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

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: ComputeTransform now inits result to identity. 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
Index: ui/gfx/transform.h
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index eeb66206afaedb7a7074d4bada5b38a41ccb955d..85bab6949cf36b8160270eb3f2c40897d907db68 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/layer_tree_host_unittest_no_message_loop.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