diff options
author | Cary Clark <caryclark@google.com> | 2016-12-08 14:36:32 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-08 20:29:37 +0000 |
commit | 7eb01e00b1a1f7c649e1e78eb3f4644033ce94ee (patch) | |
tree | 9232481f49075cbdcd7d3da22469aa7a308882bc /src/pathops/SkPathOpsCubic.h | |
parent | 9bbfb657606d4c501dd4df13cc035cf38f7672c9 (diff) |
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 <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/pathops/SkPathOpsCubic.h')
-rw-r--r-- | src/pathops/SkPathOpsCubic.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pathops/SkPathOpsCubic.h b/src/pathops/SkPathOpsCubic.h index 61de48d19c..2e8a5db3f7 100644 --- a/src/pathops/SkPathOpsCubic.h +++ b/src/pathops/SkPathOpsCubic.h @@ -47,7 +47,7 @@ struct SkDCubic { double calcPrecision() const; SkDCubicPair chopAt(double t) const; static void Coefficients(const double* cubic, double* A, double* B, double* C, double* D); - static bool ComplexBreak(const SkPoint pts[4], SkScalar* t); + static int ComplexBreak(const SkPoint pts[4], SkScalar* t); int convexHull(char order[kPointCount]) const; void debugInit() { @@ -90,6 +90,7 @@ struct SkDCubic { int searchRoots(double extremes[6], int extrema, double axisIntercept, SearchAxis xAxis, double* validRoots) const; + bool toFloatPoints(SkPoint* ) const; /** * Return the number of valid roots (0 < root < 1) for this cubic intersecting the * specified horizontal line. |