diff options
Diffstat (limited to 'chromium/ui/gfx/transform.h')
-rw-r--r-- | chromium/ui/gfx/transform.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chromium/ui/gfx/transform.h b/chromium/ui/gfx/transform.h index 5e3b8303340..5440aac71f5 100644 --- a/chromium/ui/gfx/transform.h +++ b/chromium/ui/gfx/transform.h @@ -89,6 +89,9 @@ class GFX_EXPORT Transform { // to |this|. void Scale(SkMScalar x, SkMScalar y); void Scale3d(SkMScalar x, SkMScalar y, SkMScalar z); + gfx::Vector2dF Scale2d() const { + return gfx::Vector2dF(matrix_.get(0, 0), matrix_.get(1, 1)); + } // Applies the current transformation on a translation and assigns the result // to |this|. @@ -136,6 +139,11 @@ class GFX_EXPORT Transform { // translation. bool IsIdentityOrIntegerTranslation() const; + // Returns true if the matrix had only scaling components. + bool IsScale2d() const { + return !(matrix_.getType() & ~SkMatrix44::kScale_Mask); + } + // Returns true if the matrix is has only scaling and translation components. bool IsScaleOrTranslation() const { int mask = SkMatrix44::kScale_Mask | SkMatrix44::kTranslate_Mask; |