diff options
author | 2015-04-20 08:31:59 -0700 | |
---|---|---|
committer | 2015-04-20 08:31:59 -0700 | |
commit | 1049f1246e7be4ccb68001361efceb8933e6f81c (patch) | |
tree | 9c71ceb245856cbe2173913eaec3b0ebb490dd74 /src/pathops/SkReduceOrder.cpp | |
parent | 5c476fb2776639bdbf0e974dd38d1c5d4c4ff1aa (diff) |
Now, path ops natively intersect conics, quads, and cubics in any combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall.
Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops.
TBR=reed
BUG=skia:3588
Review URL: https://codereview.chromium.org/1037953004
Diffstat (limited to 'src/pathops/SkReduceOrder.cpp')
-rw-r--r-- | src/pathops/SkReduceOrder.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pathops/SkReduceOrder.cpp b/src/pathops/SkReduceOrder.cpp index c19cd3db4b..9c19bc5686 100644 --- a/src/pathops/SkReduceOrder.cpp +++ b/src/pathops/SkReduceOrder.cpp @@ -271,6 +271,14 @@ SkPath::Verb SkReduceOrder::Quad(const SkPoint a[3], SkPoint* reducePts) { return SkPathOpsPointsToVerb(order - 1); } +SkPath::Verb SkReduceOrder::Conic(const SkPoint a[3], SkScalar weight, SkPoint* reducePts) { + SkPath::Verb verb = SkReduceOrder::Quad(a, reducePts); + if (verb > SkPath::kLine_Verb && weight == 1) { + return SkPath::kQuad_Verb; + } + return verb == SkPath::kQuad_Verb ? SkPath::kConic_Verb : verb; +} + SkPath::Verb SkReduceOrder::Cubic(const SkPoint a[4], SkPoint* reducePts) { if (SkDPoint::ApproximatelyEqual(a[0], a[1]) && SkDPoint::ApproximatelyEqual(a[0], a[2]) && SkDPoint::ApproximatelyEqual(a[0], a[3])) { |