diff options
author | Cary Clark <caryclark@google.com> | 2016-12-16 17:17:25 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-16 22:47:00 +0000 |
commit | ab2d73b06fe6c518be1d399a79c9cc39db21abb6 (patch) | |
tree | b0a7c6a51acbaeb6aaca55361a838daabd506003 /src/pathops/SkOpSegment.cpp | |
parent | ee1c73fc1b8a616ac79572759b02435698171fbf (diff) |
rework xor to be more like winding
Pathops is very well exercised with winding paths,
but less so with xor (even odd) paths.
Rewrite the xor main loop to look like the winding
one to take advantage of the latter's bug fixes.
TBR=reed@google.com
BUG=skia:6041
Change-Id: Ied8d522254a327b1817b54f0abbf4414f5fab7da
Reviewed-on: https://skia-review.googlesource.com/6228
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/pathops/SkOpSegment.cpp')
-rw-r--r-- | src/pathops/SkOpSegment.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp index 95f4a983f2..58c71af437 100644 --- a/src/pathops/SkOpSegment.cpp +++ b/src/pathops/SkOpSegment.cpp @@ -1619,16 +1619,16 @@ bool SkOpSegment::testForCoincidence(const SkOpPtT* priorPtT, const SkOpPtT* ptT return coincident; } -void SkOpSegment::undoneSpan(SkOpSpanBase** start, SkOpSpanBase** end) { - SkOpSpan* span = this->head(); +SkOpSpan* SkOpSegment::undoneSpan() { + SkOpSpan* span = &fHead; + SkOpSpanBase* next; do { + next = span->next(); if (!span->done()) { - break; + return span; } - } while ((span = span->next()->upCastable())); - SkASSERT(span); - *start = span; - *end = span->next(); + } while (!next->final() && (span = next->upCast())); + return nullptr; } int SkOpSegment::updateOppWinding(const SkOpSpanBase* start, const SkOpSpanBase* end) const { |