aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMatrix.cpp
diff options
context:
space:
mode:
authorGravatar Ben Wagner <benjaminwagner@google.com>2017-09-16 19:04:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-18 17:23:39 +0000
commita9712a511316ef888d008d5f993f3300e9aacd67 (patch)
treedb40e18a39094e97cd98141328f37fe8cee44cff /src/core/SkMatrix.cpp
parenteafa64b4018a334daae74492fb33bc54bd0bb6aa (diff)
Suppress float-cast-overflow for double-to-float in SkMatrix{,44}
No API change. Bug: skia:4632 Change-Id: Ic9cb9de7cce8aca43f0ce8066abcc44a0b04ca84 Reviewed-on: https://skia-review.googlesource.com/47681 Commit-Queue: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkMatrix.cpp')
-rw-r--r--src/core/SkMatrix.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index 5feee12874..0ed9565fb9 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -770,7 +770,8 @@ static double sk_inv_determinant(const float mat[9], int isPerspective) {
// Since the determinant is on the order of the cube of the matrix members,
// compare to the cube of the default nearly-zero constant (although an
// estimate of the condition number would be better if it wasn't so expensive).
- if (SkScalarNearlyZero((float)det, SK_ScalarNearlyZero * SK_ScalarNearlyZero * SK_ScalarNearlyZero)) {
+ if (SkScalarNearlyZero(sk_double_to_float(det),
+ SK_ScalarNearlyZero * SK_ScalarNearlyZero * SK_ScalarNearlyZero)) {
return 0;
}
return 1.0 / det;