These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed
While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.
TBR=
BUG=421132
Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2
Review URL: https://codereview.chromium.org/633393002
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h
index 899367a..7a1cc09 100644
--- a/src/pathops/SkOpContour.h
+++ b/src/pathops/SkOpContour.h
@@ -127,9 +127,9 @@
}
}
- void checkEnds() {
+ bool checkEnds() {
if (!fContainsCurves) {
- return;
+ return true;
}
int segmentCount = fSegments.count();
for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
@@ -140,8 +140,11 @@
if (segment->done()) {
continue; // likely coincident, nothing to do
}
- segment->checkEnds();
+ if (!segment->checkEnds()) {
+ return false;
+ }
}
+ return true;
}
void checkMultiples() {