diff options
author | 2015-05-14 05:45:54 -0700 | |
---|---|---|
committer | 2015-05-14 05:45:54 -0700 | |
commit | 182b499cd75c971f85cdf52c1827b3c220cc9011 (patch) | |
tree | 70d3a7884731de198bf99afb0914cb390639c420 /src | |
parent | eea2ff72014d985166e8c2aab3537bd32591900a (diff) |
look for deleted pts when detecting line/curve coincident edges
TBR=reed@google.com
BUG=skia:3651
Review URL: https://codereview.chromium.org/1129863007
Diffstat (limited to 'src')
-rwxr-xr-x | src/pathops/SkOpCoincidence.cpp | 10 | ||||
-rw-r--r-- | src/pathops/SkOpSegment.cpp | 9 | ||||
-rw-r--r-- | src/pathops/SkPathOpsDebug.cpp | 2 |
3 files changed, 17 insertions, 4 deletions
diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp index ed195641bf..eb0ccc1737 100755 --- a/src/pathops/SkOpCoincidence.cpp +++ b/src/pathops/SkOpCoincidence.cpp @@ -195,12 +195,18 @@ bool SkOpCoincidence::apply() { return true; } do { - SkOpSpanBase* end = coin->fCoinPtTEnd->span(); SkOpSpan* start = coin->fCoinPtTStart->span()->upCast(); + if (start->deleted()) { + continue; + } + SkOpSpanBase* end = coin->fCoinPtTEnd->span(); SkASSERT(start == start->starter(end)); bool flipped = coin->fFlipped; - SkOpSpanBase* oEnd = (flipped ? coin->fOppPtTStart : coin->fOppPtTEnd)->span(); SkOpSpan* oStart = (flipped ? coin->fOppPtTEnd : coin->fOppPtTStart)->span()->upCast(); + if (oStart->deleted()) { + continue; + } + SkOpSpanBase* oEnd = (flipped ? coin->fOppPtTStart : coin->fOppPtTEnd)->span(); SkASSERT(oStart == oStart->starter(oEnd)); SkOpSegment* segment = start->segment(); SkOpSegment* oSegment = oStart->segment(); diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp index 01417d6b8f..8bd0f03518 100644 --- a/src/pathops/SkOpSegment.cpp +++ b/src/pathops/SkOpSegment.cpp @@ -1119,6 +1119,9 @@ void SkOpSegment::missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc SkOpPtT* ptT = spanBase->ptT(), * spanStopPtT = ptT; SkASSERT(ptT->span() == spanBase); while ((ptT = ptT->next()) != spanStopPtT) { + if (ptT->deleted()) { + continue; + } SkOpSegment* opp = ptT->span()->segment(); if (opp->verb() == SkPath::kLine_Verb) { continue; @@ -1149,6 +1152,9 @@ void SkOpSegment::missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc while (!priorOpp && priorTest) { priorStopPtT = priorPtT = priorTest->ptT(); while ((priorPtT = priorPtT->next()) != priorStopPtT) { + if (priorPtT->deleted()) { + continue; + } SkOpSegment* segment = priorPtT->span()->segment(); if (segment == opp) { prior = priorTest; @@ -1203,7 +1209,8 @@ void SkOpSegment::missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc } if (coincident) { // mark coincidence - if (!coincidences->extend(priorPtT, ptT, oppStart, oppEnd)) { + if (!coincidences->extend(priorPtT, ptT, oppStart, oppEnd) + && !coincidences->extend(oppStart, oppEnd, priorPtT, ptT)) { coincidences->add(priorPtT, ptT, oppStart, oppEnd, allocator); } clear_visited(&fHead); diff --git a/src/pathops/SkPathOpsDebug.cpp b/src/pathops/SkPathOpsDebug.cpp index 2903e08984..d28dc72924 100644 --- a/src/pathops/SkPathOpsDebug.cpp +++ b/src/pathops/SkPathOpsDebug.cpp @@ -364,7 +364,7 @@ void SkOpAngle::debugValidate() const { } next = next->fNext; } while (next && next != first); - SkASSERT(wind == 0); + SkASSERT(wind == 0 || !FLAGS_runFail); SkASSERT(opp == 0 || !FLAGS_runFail); #endif } |