diff options
author | caryclark <caryclark@google.com> | 2016-07-21 10:44:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-21 10:44:07 -0700 |
commit | 81681949d363f777809af167c70912ca2a612036 (patch) | |
tree | ac25957855bafa3b847011f83f9bbf84e07dfde1 /src/pathops/SkOpAngle.cpp | |
parent | 85f0e63ca476568143a36242b438390f7e6d5c82 (diff) |
allow curves on side of lines to be very small
Increase the precision of the 'all on one side' pathops
angle test to reduce the number of unorderable segments
found by the cubics_d3 test.
This allows pathsops_unittest release build with -v -V -x
to run without error.
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2168163002
Review-Url: https://codereview.chromium.org/2168163002
Diffstat (limited to 'src/pathops/SkOpAngle.cpp')
-rw-r--r-- | src/pathops/SkOpAngle.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pathops/SkOpAngle.cpp b/src/pathops/SkOpAngle.cpp index 479a6f673d..2da8357add 100644 --- a/src/pathops/SkOpAngle.cpp +++ b/src/pathops/SkOpAngle.cpp @@ -181,15 +181,15 @@ int SkOpAngle::allOnOneSide(const SkOpAngle* test) { SkASSERT(test->fIsCurve); SkDPoint origin = fCurvePart[0]; SkDVector line = fCurvePart[1] - origin; - float crosses[3]; + double crosses[3]; SkPath::Verb testVerb = test->segment()->verb(); int iMax = SkPathOpsVerbToPoints(testVerb); // SkASSERT(origin == test.fCurveHalf[0]); const SkDCurve& testCurve = test->fCurvePart; for (int index = 1; index <= iMax; ++index) { - float xy1 = (float) (line.fX * (testCurve[index].fY - origin.fY)); - float xy2 = (float) (line.fY * (testCurve[index].fX - origin.fX)); - crosses[index - 1] = AlmostEqualUlps(xy1, xy2) ? 0 : xy1 - xy2; + double xy1 = line.fX * (testCurve[index].fY - origin.fY); + double xy2 = line.fY * (testCurve[index].fX - origin.fX); + crosses[index - 1] = AlmostBequalUlps(xy1, xy2) ? 0 : xy1 - xy2; } if (crosses[0] * crosses[1] < 0) { return -1; |