SkOpSegment* SkOpContour::nonVerticalSegment(int* start, int* end) { int segmentCount = fSortedSegments.count(); SkASSERT(segmentCount > 0); for (int sortedIndex = fFirstSorted; sortedIndex < segmentCount; ++sortedIndex) { SkOpSegment* testSegment = fSortedSegments[sortedIndex]; if (testSegment->done()) { continue; } *start = *end = 0; while (testSegment->nextCandidate(start, end)) { if (!testSegment->isVertical(*start, *end)) { return testSegment; } } } return NULL; }
SkOpSegment* SkOpContour::nonVerticalSegment(SkOpSpanBase** start, SkOpSpanBase** end) { int segmentCount = fSortedSegments.count(); SkASSERT(segmentCount > 0); for (int sortedIndex = fFirstSorted; sortedIndex < segmentCount; ++sortedIndex) { SkOpSegment* testSegment = fSortedSegments[sortedIndex]; if (testSegment->done()) { continue; } SkOpSpanBase* span = testSegment->head(); SkOpSpanBase* testS, * testE; while (SkOpSegment::NextCandidate(span, &testS, &testE)) { if (!testSegment->isVertical(testS, testE)) { *start = testS; *end = testE; return testSegment; } span = span->upCast()->next(); } } return NULL; }