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/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index 00c02e8..fbfa0b5 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -1719,17 +1719,10 @@
     SkPath pathB;
     pathB.setFillType(SkPath::kWinding_FillType);
     pathB.moveTo(704.000000f, 3.00000000f);
-#if 0
-    pathB.lineTo(719.500000f, 3.00000000f);
-    pathB.lineTo(705.000000f, 33.0000000f);
-    pathB.lineTo(704.000000f, 33.0000000f);
-    testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
-#else
     pathB.lineTo(704.000000f, 33.0000000f);
     pathB.lineTo(705.000000f, 33.0000000f);
     pathB.lineTo(719.500000f, 3.00000000f);
     testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
-#endif
 }
 
 static void skpahrefs_com88(skiatest::Reporter* reporter, const char* filename) {
@@ -2733,9 +2726,6 @@
 
 // this fails because cubic/quad misses an intersection (failure is isolated in c/q int test)
 static void skpcarrot_is24(skiatest::Reporter* reporter, const char* filename) {
-    if (!FLAGS_runFail) {
-        return;
-    }
     SkPath path;
     path.setFillType(SkPath::kEvenOdd_FillType);
     path.moveTo(945, 597);
@@ -2758,7 +2748,7 @@
     pathB.cubicTo(1019.77502f, 679.955017f, 1020.08099f, 676.094971f, 1020.08099f, 672.161987f);
     pathB.cubicTo(1020.08002f, 630.73999f, 986.502014f, 597.161987f, 945.080994f, 597.161987f);
     pathB.close();
-    testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
+    testPathOpCheck(reporter, path, pathB, kIntersect_PathOp, filename, FLAGS_runFail);
 }
 
 static void skpbangalorenest_com4(skiatest::Reporter* reporter, const char* filename) {
@@ -3283,9 +3273,6 @@
 }
 
 static void cubicOp114(skiatest::Reporter* reporter, const char* filename) {
-    if (!FLAGS_runFail) {
-        return;
-    }
     SkPath path, pathB;
     path.setFillType(SkPath::kWinding_FillType);
     path.moveTo(0, 1);
@@ -3295,7 +3282,7 @@
     pathB.moveTo(1, 3);
     pathB.cubicTo(-1, 2, 3.5f, 1.33333337f, 0, 1);
     pathB.close();
-    testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
+    testPathOpCheck(reporter, path, pathB, kIntersect_PathOp, filename, FLAGS_runFail);
 }
 
 static void cubicOp114asQuad(skiatest::Reporter* reporter, const char* filename) {
@@ -3461,9 +3448,6 @@
 }
 
 static void issue2753(skiatest::Reporter* reporter, const char* filename) {
-    if (!FLAGS_runFail) {
-        return;
-    }
     SkPath path1;
     path1.moveTo(142.701f, 110.568f);
     path1.lineTo(142.957f, 100);
@@ -3480,7 +3464,7 @@
     path2.cubicTo(188.201f, 117.601f, 174.801f, 93, 39, 124.001f);
     path2.close();
 
-    testPathOp(reporter, path1, path2, kUnion_PathOp, filename);
+    testPathOpCheck(reporter, path1, path2, kUnion_PathOp, filename, FLAGS_runFail);
 }
 
 static void issue2808(skiatest::Reporter* reporter, const char* filename) {
@@ -3511,10 +3495,25 @@
     testPathOp(reporter, path1, path2, kUnion_PathOp, filename);
 }
 
+static void cubicOp115(skiatest::Reporter* reporter, const char* filename) {
+    SkPath path, pathB;
+    path.setFillType(SkPath::kWinding_FillType);
+    path.moveTo(0,1);
+    path.cubicTo(3,4, 2,1, 5,3);
+    path.close();
+    pathB.setFillType(SkPath::kWinding_FillType);
+    pathB.moveTo(1,2);
+    pathB.cubicTo(3,5, 1,0, 4,3);
+    pathB.close();
+    SkPath path2(path);
+    testPathOp(reporter, path, pathB, kDifference_PathOp, filename);
+}
+
 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
 
 static struct TestDesc tests[] = {
+    TEST(cubicOp115),
     TEST(issue2753),  // FIXME: pair of cubics miss intersection
     TEST(cubicOp114),  // FIXME: curve with inflection is ordered the wrong way
     TEST(issue2808),