From 7eb01e00b1a1f7c649e1e78eb3f4644033ce94ee Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 8 Dec 2016 14:36:32 -0500 Subject: simplify bug The path contains a cubic with a very tight curve. Split the cubic into pieces so that the individual curves are better behaved. Use both inflections and max curvature to potentially split cubics. Since this may require a bit of work, preflight to ignore cubics that monotonically change in x and y. Only one of the three tests referred to by the bug below repro'd. Use path.dumpHex() instead of path.dump() to capture the crashing data. TBR=reed@google.com BUG=skia:6041 Change-Id: I29a264f87242cacc7c421e7685b90aca81621c74 Reviewed-on: https://skia-review.googlesource.com/5702 Reviewed-by: Cary Clark Commit-Queue: Cary Clark --- samplecode/SampleAAGeometry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'samplecode/SampleAAGeometry.cpp') diff --git a/samplecode/SampleAAGeometry.cpp b/samplecode/SampleAAGeometry.cpp index 506b1bc0b7..875db26ca2 100644 --- a/samplecode/SampleAAGeometry.cpp +++ b/samplecode/SampleAAGeometry.cpp @@ -1219,8 +1219,8 @@ public: draw_points(canvas, pts, 3); } break; case SkPath::kCubic_Verb: { - SkScalar loopT; - bool complex = SkDCubic::ComplexBreak(pts, &loopT); + SkScalar loopT[3]; + int complex = SkDCubic::ComplexBreak(pts, loopT); SkPath cPath; cPath.moveTo(pts[0]); cPath.cubicTo(pts[1], pts[2], pts[3]); -- cgit v1.2.3