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