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; |