diff options
author | caryclark <caryclark@google.com> | 2014-08-12 05:49:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-12 05:49:37 -0700 |
commit | 80a83adaf2f8db849bfae288e31b7c789dafabf5 (patch) | |
tree | bcd309242d9c40a924e081367b5cac669f881d4b /src/pathops | |
parent | c019ec412ba2704bc6e2cdfd321ea06787ba415d (diff) |
relax quadratic binary search test
Extreme implicit quartic equations solve to roots that are different
enough that they appear to have failed. In this case, fall back on
binary searching to find an intersection.
Relax the condition when this happens; don't give up just because the
computed implicit root points aren't remotely the same.
TBR=reed
BUG=skia:2808
Author: caryclark@google.com
Review URL: https://codereview.chromium.org/456383003
Diffstat (limited to 'src/pathops')
-rw-r--r-- | src/pathops/SkDQuadIntersection.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pathops/SkDQuadIntersection.cpp b/src/pathops/SkDQuadIntersection.cpp index 5a8bafcdc5..239711c321 100644 --- a/src/pathops/SkDQuadIntersection.cpp +++ b/src/pathops/SkDQuadIntersection.cpp @@ -486,8 +486,8 @@ int SkIntersections::intersect(const SkDQuad& q1, const SkDQuad& q2) { if (r1Count == 1 && used() == 0) { if (pts1[0].approximatelyEqual(pts2[0])) { insert(roots1Copy[0], roots2Copy[0], pts1[0]); - } else if (pts1[0].moreRoughlyEqual(pts2[0])) { - // experiment: try to find intersection by chasing t + } else { + // find intersection by chasing t if (binary_search(q1, q2, roots1Copy, roots2Copy, pts1)) { insert(roots1Copy[0], roots2Copy[0], pts1[0]); } |