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

Unified Diff: ui/gfx/transform.h

Issue 822713002: Update from https://crrev.com/309415 (Closed) Base URL: https://github.com/domokit/mojo.git@master
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
Index: ui/gfx/transform.h
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 6028fb37b4328ff677e05669bc331819c65e4947..8156b7265c936004178dbfd74f8fea36af7d83f0 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;

Powered by Google App Engine
This is Rietveld 408576698