summaryrefslogtreecommitdiffstats
path: root/skia/corecg/SkMatrix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'skia/corecg/SkMatrix.cpp')
-rw-r--r--skia/corecg/SkMatrix.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/skia/corecg/SkMatrix.cpp b/skia/corecg/SkMatrix.cpp
index d5b64ec..4c9a087 100644
--- a/skia/corecg/SkMatrix.cpp
+++ b/skia/corecg/SkMatrix.cpp
@@ -667,9 +667,12 @@ bool SkMatrix::postConcat(const SkMatrix& mat) {
det = (double)mat[SkMatrix::kMScaleX] * mat[SkMatrix::kMScaleY] - (double)mat[SkMatrix::kMSkewX] * mat[SkMatrix::kMSkewY];
}
- if (SkScalarNearlyZero((float)det)) {
+ // Since the determinant is on the order of the square of the matrix members,
+ // compare to the square of the default nearly-zero constant
+ if (SkScalarNearlyZero((float)det, SK_ScalarNearlyZero * SK_ScalarNearlyZero)) {
return 0;
}
+
return (float)(1.0 / det);
}
#else