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

Unified Diff: include/core/SkMatrix.h

Issue 1532963002: Make SkMatrix::get*Scale[s]() fail on NaN (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add SK_WARN_UNUSED_RESULT Created 5 years 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
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkMatrix.h
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index 97a53505ef3734ae36de8d5e0799b07d4c4e075a..0ebe3280e2180778fa6fa32564baf1fe401d5ee0 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
« no previous file with comments | « no previous file | src/core/SkMatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698