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

Unified Diff: ui/gfx/transform.h

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove content_bounds() usage, fix unit test. Created 6 years, 11 months 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 5e3b83033403e442f455e5b7dce4623b4c0b4f58..db77b884198c795e11c6f5d8a262cf40732e8c41 100644
--- a/ui/gfx/transform.h
+++ b/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 Scale() const {
enne (OOO) 2014/01/21 19:00:06 Scale2d?
wjmaclean 2014/01/21 22:37:27 Done.
+ 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 IsScale() const {
enne (OOO) 2014/01/21 19:00:06 Scale2d?
wjmaclean 2014/01/21 22:37:27 Done.
+ 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;

Powered by Google App Engine
This is Rietveld 408576698