aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-12-17 15:33:13 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-17 15:33:13 -0800
commitef2c7c705748e4c563c468f667dae7a9a38ffabc (patch)
tree3c001e7b92a3c609d105cc91fdcf2a83d9939841 /include/core
parentdafd044e4aea529f88d899247678d4549f776388 (diff)
Make SkMatrix::get*Scale[s]() fail on NaN
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkMatrix.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index 97a53505ef..0ebe3280e2 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -635,15 +635,17 @@ public:
/**
* Calculates the minimum scaling factor of the matrix as computed from the SVD of the upper
- * left 2x2. If the matrix has perspective -1 is returned.
+ * left 2x2. If the max scale factor cannot be computed (for example overflow or perspective)
+ * -1 is returned.
*
- * @return minumum scale factor
+ * @return minimum scale factor
*/
SkScalar getMinScale() const;
/**
* Calculates the maximum scaling factor of the matrix as computed from the SVD of the upper
- * left 2x2. If the matrix has perspective -1 is returned.
+ * left 2x2. If the max scale factor cannot be computed (for example overflow or perspective)
+ * -1 is returned.
*
* @return maximum scale factor
*/
@@ -651,10 +653,10 @@ public:
/**
* Gets both the min and max scale factors. The min scale factor is scaleFactors[0] and the max
- * is scaleFactors[1]. If the matrix has perspective false will be returned and scaleFactors
- * will be unchanged.
+ * is scaleFactors[1]. If the min/max scale factors cannot be computed false is returned and the
+ * values of scaleFactors[] are undefined.
*/
- bool getMinMaxScales(SkScalar scaleFactors[2]) const;
+ bool SK_WARN_UNUSED_RESULT getMinMaxScales(SkScalar scaleFactors[2]) const;
/**
* Attempt to decompose this matrix into a scale-only component and whatever remains, where