diff options
-rw-r--r-- | experimental/Intersection/Simplify.cpp | 21 | ||||
-rw-r--r-- | experimental/Intersection/SimplifyFindNext_Test.cpp | 2 |
2 files changed, 14 insertions, 9 deletions
diff --git a/experimental/Intersection/Simplify.cpp b/experimental/Intersection/Simplify.cpp index 8cdec8f994..859755f5f6 100644 --- a/experimental/Intersection/Simplify.cpp +++ b/experimental/Intersection/Simplify.cpp @@ -1157,9 +1157,10 @@ public: // it is guaranteed to have an end which describes a non-zero length (?) // winding -1 means ccw, 1 means cw // firstFind allows coincident edges to be treated differently - Segment* findNext(SkTDArray<Span*>& chase, int winding, const int startIndex, - const int endIndex, - int& nextStart, int& nextEnd, int& flipped, bool firstFind) { + Segment* findNext(SkTDArray<Span*>& chase, int winding, + const int startIndex, const int endIndex, + int& nextStart, int& nextEnd, int& flipped, bool firstFind + ,bool active /* active param is debugging only */ ) { SkASSERT(startIndex != endIndex); int count = fTs.count(); SkASSERT(startIndex < endIndex ? startIndex < count - 1 @@ -1217,11 +1218,14 @@ public: } firstEdge = false; if (!winding) { + if (!active) { + SkASSERT(nextAngle->segment() == this); + markWinding(SkMin32(nextAngle->start(), nextAngle->end()), + maxWinding); + SkDebugf("%s inactive\n", __FUNCTION__); + return NULL; + } if (!foundAngle) { -#if 0 - nextAngle->segment()->markWinding( - SkMin32(nextAngle->start(), nextAngle->end()), maxWinding); -#endif foundAngle = nextAngle; } continue; @@ -2941,7 +2945,8 @@ static void bridge(SkTDArray<Contour*>& contourList, SkPath& simple) { int nextStart, nextEnd, flipped = 1; Segment* next = current->findNext(chaseArray, winding + spanWinding, index, - endIndex, nextStart, nextEnd, flipped, firstTime); + endIndex, nextStart, nextEnd, flipped, firstTime + , active /* active is debugging only */ ); if (!next) { break; } diff --git a/experimental/Intersection/SimplifyFindNext_Test.cpp b/experimental/Intersection/SimplifyFindNext_Test.cpp index 4edc53254f..8ae35d2082 100644 --- a/experimental/Intersection/SimplifyFindNext_Test.cpp +++ b/experimental/Intersection/SimplifyFindNext_Test.cpp @@ -35,7 +35,7 @@ static const SimplifyFindNextTest::Segment* testCommon( int nextStart, nextEnd, flipped = 1; SkTDArray<SimplifyFindNextTest::Span*> chaseArray; SimplifyFindNextTest::Segment* next = segment.findNext(chaseArray, winding, - startIndex, endIndex, nextStart, nextEnd, flipped, true); + startIndex, endIndex, nextStart, nextEnd, flipped, true, true); pts[1] = next->xyAtT(&next->span(nextStart)); SkASSERT(pts[0] == pts[1]); return next; |