From 182b499cd75c971f85cdf52c1827b3c220cc9011 Mon Sep 17 00:00:00 2001 From: caryclark Date: Thu, 14 May 2015 05:45:54 -0700 Subject: look for deleted pts when detecting line/curve coincident edges TBR=reed@google.com BUG=skia:3651 Review URL: https://codereview.chromium.org/1129863007 --- src/pathops/SkOpSegment.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/pathops/SkOpSegment.cpp') 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); -- cgit v1.2.3