diff options
author | 2013-06-04 17:59:42 +0000 | |
---|---|---|
committer | 2013-06-04 17:59:42 +0000 | |
commit | cffbcc3b9665f2c928544b6fc6b8a0e22a4210fb (patch) | |
tree | ed16b540c395c4e1c91733d9198575c2352efc06 /src/pathops/SkPathOpsOp.cpp | |
parent | 4075fd485101eea80cc67c396e6839e555ab948a (diff) |
path ops -- rewrite angle sort
This is a major change resulting from a minor
tweak. In the old code, the intersection point
of two curves was shared between them, but the
intersection points and end points of sorted edges was
computed directly from the intersection T value.
In this CL, both intersection points and sorted points
are the same, and intermediate control points are computed
to preserve their slope.
The sort itself has been completely rewritten to be more
robust and remove 'magic' checks, conditions that empirically
worked but couldn't be rationalized.
This CL was triggered by errors generated computing the clips
of SKP files. At this point, all 73M standard tests work and
at least the first troublesome SKPs work.
Review URL: https://codereview.chromium.org/15338003
git-svn-id: http://skia.googlecode.com/svn/trunk@9432 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkPathOpsOp.cpp')
-rw-r--r-- | src/pathops/SkPathOpsOp.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pathops/SkPathOpsOp.cpp b/src/pathops/SkPathOpsOp.cpp index db55635d89..f030765a61 100644 --- a/src/pathops/SkPathOpsOp.cpp +++ b/src/pathops/SkPathOpsOp.cpp @@ -37,7 +37,8 @@ static SkOpSegment* findChaseOp(SkTDArray<SkOpSpan*>& chase, int& nextStart, int continue; } SkTDArray<SkOpAngle*> sorted; - bool sortable = SkOpSegment::SortAngles(angles, &sorted); + bool sortable = SkOpSegment::SortAngles(angles, &sorted, + SkOpSegment::kMayBeUnordered_SortAngleKind); int angleCount = sorted.count(); #if DEBUG_SORT sorted[0]->segment()->debugShowSort(__FUNCTION__, sorted, 0); @@ -232,6 +233,7 @@ static const bool gOutInverse[kReverseDifference_PathOp + 1][2][2] = { bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) { #if DEBUG_SHOW_PATH + ShowFunctionHeader(); ShowPath(one, "path"); ShowPath(two, "pathB"); ShowOp(op, "path", "pathB"); |