diff options
author | 2015-03-19 16:10:54 -0700 | |
---|---|---|
committer | 2015-03-19 16:10:54 -0700 | |
commit | adf9990cb56ca389f37f02ac637496083b3c3cfc (patch) | |
tree | 9836e2845d7cc22b84d5f035d868610925b38f1d /include | |
parent | d800d878caae5d25b275d488a1b5ae8c24cea492 (diff) |
add SkMatrix::decomposeScale
BUG=skia:
Review URL: https://codereview.chromium.org/1006173005
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkMatrix.h | 13 |
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(); |