fix pathops fuzz failures
If a curve has the identical start and control points, the
initial or final tangent can't be trivally determined. The
perpendicular to the tangent is used to measure coincidence.
Add logic for cubics, quadratics, and conics, to use the
secondary control points or the end points if the initial
control point alone can't determine the tangent.
Add debugging (currently untriggered by exhaustive testing)
to detect zero-length tangents which are not at the curve
endpoints.
Increase the number of temporary intersecions gathered from
10 to 12 but reduce the max passed in by cubic intersection from
27 to 12. Also, add checks if the max passed exceeds the
storage allocated.
When cleaning up parallel lines, choose the intersection which
is on the end of both segments over the intersection which
is on the end of a single segment.
TBR=reed@google.com
BUG=425140,516266
Review URL: https://codereview.chromium.org/1288863004
diff --git a/tests/PathOpsCubicIntersectionTest.cpp b/tests/PathOpsCubicIntersectionTest.cpp
index 138e6f4..75a5cc3 100644
--- a/tests/PathOpsCubicIntersectionTest.cpp
+++ b/tests/PathOpsCubicIntersectionTest.cpp
@@ -653,6 +653,11 @@
}
static const SkDCubic coinSet[] = {
+ {{{297.04998779296875, 43.928997039794922}, {297.04998779296875, 43.928997039794922},
+ {300.69699096679688, 45.391998291015625}, {306.92498779296875, 43.08599853515625}}},
+ {{{297.04998779296875, 43.928997039794922}, {297.04998779296875, 43.928997039794922},
+ {300.69699096679688, 45.391998291015625}, {306.92498779296875, 43.08599853515625}}},
+
{{{2, 3}, {0, 4}, {3, 2}, {5, 3}}},
{{{2, 3}, {0, 4}, {3, 2}, {5, 3}}},