aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-19 16:10:54 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-19 16:10:54 -0700
commitadf9990cb56ca389f37f02ac637496083b3c3cfc (patch)
tree9836e2845d7cc22b84d5f035d868610925b38f1d /include
parentd800d878caae5d25b275d488a1b5ae8c24cea492 (diff)
add SkMatrix::decomposeScale
Diffstat (limited to 'include')
-rw-r--r--include/core/SkMatrix.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index a272051067..b2ee3c61bf 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -624,6 +624,19 @@ public:
bool getMinMaxScales(SkScalar scaleFactors[2]) const;
/**
+ * Attempt to decompose this matrix into a scale-only component and whatever remains, where
+ * the scale component is to be applied first.
+ *
+ * M -> Remaining * Scale
+ *
+ * On success, return true and assign the scale and remaining components (assuming their
+ * respective parameters are not null). On failure return false and ignore the parameters.
+ *
+ * Possible reasons to fail: perspective, one or more scale factors are zero.
+ */
+ bool decomposeScale(SkSize* scale, SkMatrix* remaining = NULL) const;
+
+ /**
* Return a reference to a const identity matrix
*/
static const SkMatrix& I();