aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMatrix.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-02-12 11:46:19 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-12 19:04:19 +0000
commitfaffa867716049c6b983312f034f6b54e3bccddc (patch)
tree2ec0b3ec4ab81d3bc675279735429b85a1bb7143 /src/core/SkMatrix.cpp
parent154771b4dccff130d246c6b067129bafd64afb1a (diff)
begin to wrap all float divides
Bug: skia:7607 skia:6134 Change-Id: Id126e92816bef1df1372bd531238cda9f3b36fab Reviewed-on: https://skia-review.googlesource.com/106261 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkMatrix.cpp')
-rw-r--r--src/core/SkMatrix.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index 9a70fbbc7d..778d77c432 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -6,6 +6,7 @@
*/
#include "SkFloatBits.h"
+#include "SkMathPriv.h"
#include "SkMatrixPriv.h"
#include "SkNx.h"
#include "SkPaint.h"
@@ -1363,32 +1364,32 @@ bool SkMatrix::Poly4Proc(const SkPoint srcPt[], SkMatrix* dst,
/* check if abs(x2) > abs(y2) */
if ( x2 > 0 ? y2 > 0 ? x2 > y2 : x2 > -y2 : y2 > 0 ? -x2 > y2 : x2 < y2) {
- float denom = (x1 * y2 / x2) - y1;
+ float denom = sk_ieee_float_divide(x1 * y2, x2) - y1;
if (checkForZero(denom)) {
return false;
}
a1 = (((x0 - x1) * y2 / x2) - y0 + y1) / denom;
} else {
- float denom = x1 - (y1 * x2 / y2);
+ float denom = x1 - sk_ieee_float_divide(y1 * x2, y2);
if (checkForZero(denom)) {
return false;
}
- a1 = (x0 - x1 - ((y0 - y1) * x2 / y2)) / denom;
+ a1 = (x0 - x1 - sk_ieee_float_divide((y0 - y1) * x2, y2)) / denom;
}
/* check if abs(x1) > abs(y1) */
if ( x1 > 0 ? y1 > 0 ? x1 > y1 : x1 > -y1 : y1 > 0 ? -x1 > y1 : x1 < y1) {
- float denom = y2 - (x2 * y1 / x1);
+ float denom = y2 - sk_ieee_float_divide(x2 * y1, x1);
if (checkForZero(denom)) {
return false;
}
- a2 = (y0 - y2 - ((x0 - x2) * y1 / x1)) / denom;
+ a2 = (y0 - y2 - sk_ieee_float_divide((x0 - x2) * y1, x1)) / denom;
} else {
- float denom = (y2 * x1 / y1) - x2;
+ float denom = sk_ieee_float_divide(y2 * x1, y1) - x2;
if (checkForZero(denom)) {
return false;
}
- a2 = (((y0 - y2) * x1 / y1) - x0 + x2) / denom;
+ a2 = (sk_ieee_float_divide((y0 - y2) * x1, y1) - x0 + x2) / denom;
}
float invScale = SkScalarInvert(scale.fX);