diff options
Diffstat (limited to 'skia')
-rw-r--r-- | skia/corecg/SkMatrix.cpp | 5 | ||||
-rw-r--r-- | skia/sgl/SkScan_Path.cpp | 2 |
2 files changed, 5 insertions, 2 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 diff --git a/skia/sgl/SkScan_Path.cpp b/skia/sgl/SkScan_Path.cpp index 81b0233..4e58518 100644 --- a/skia/sgl/SkScan_Path.cpp +++ b/skia/sgl/SkScan_Path.cpp @@ -368,7 +368,7 @@ extern "C" { valuea = edgea->fX; valueb = edgeb->fX; } - return valuea - valueb; + return valuea > valueb ? 1 : valuea < valueb ? -1 : 0; } } |