diff options
author | 2015-12-17 15:33:13 -0800 | |
---|---|---|
committer | 2015-12-17 15:33:13 -0800 | |
commit | ef2c7c705748e4c563c468f667dae7a9a38ffabc (patch) | |
tree | 3c001e7b92a3c609d105cc91fdcf2a83d9939841 /include/core | |
parent | dafd044e4aea529f88d899247678d4549f776388 (diff) |
Make SkMatrix::get*Scale[s]() fail on NaN
BUG=skia:4718
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1532963002
Review URL: https://codereview.chromium.org/1532963002
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkMatrix.h | 14 |
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 |