Lines Matching refs:span
32 #define FAIL_WITH_NULL_IF(cond, span) \
33 do { if (cond) log->record(SkPathOpsDebug::kFail_Glitch, span); } while (false)
35 #define RETURN_FALSE_IF(cond, span) \
36 do { if (cond) log->record(SkPathOpsDebug::kReturnFalse_Glitch, span); \
56 const SkOpSpanBase* span) {
59 if (entry == span) {
202 const SkOpSpan* span) {
205 glitch->fBase = span;
208 void record(GlitchType type, double t, const SkOpSpanBase* span) {
211 glitch->fBase = span;
392 glitch.fCoinSpan->span()->debugID(), glitch.fCoinSpan->debugID());
399 glitch.fOppSpan->span()->debugID(), glitch.fOppSpan->debugID());
727 const SkOpSpanBase* span = &fHead;
729 const SkOpPtT* result = span->ptT();
731 // span->bumpSpanAdds();
735 const SkOpSpan* prev = result->span()->prev();
736 FAIL_WITH_NULL_IF(!prev, span);
737 // marks in global state that new op span has been allocated
739 // span->init(this, prev, t, pt);
743 // span->segment()->debugID(), span->debugID());
745 // span->bumpSpanAdds();
748 FAIL_WITH_NULL_IF(span != &fTail, span);
749 } while ((span = span->upCast()->next()));
758 const SkOpSpan* span;
767 span = base->upCast();
768 angle = span->toAngle();
772 } while ((base = span->next()));
786 const SkOpSpan* span = &fHead;
788 this->debugClearOne(span, glitches);
789 } while ((span = span->next()->upCastable()));
794 void SkOpSegment::debugClearOne(const SkOpSpan* span, SkPathOpsDebug::GlitchLog* glitches) const {
795 if (span->windValue()) glitches->record(SkPathOpsDebug::kCollapsedWindValue_Glitch, span);
796 if (span->oppValue()) glitches->record(SkPathOpsDebug::kCollapsedOppValue_Glitch, span);
797 if (!span->done()) glitches->record(SkPathOpsDebug::kCollapsedDone_Glitch, span);
803 SkOpSpan* span = this->head();
805 if (span->toAngle()) {
807 result = span->toAngle();
809 } while ((span = span->next()->upCastable()));
816 void SkOpSegment::DebugClearVisited(const SkOpSpanBase* span) {
819 const SkOpPtT* ptT = span->ptT(), * stopPtT = ptT;
824 } while (!span->final() && (span = span->upCast()->next()));
848 SkASSERT(ptT->span() == spanBase);
853 const SkOpSegment* opp = ptT->span()->segment();
867 const SkOpSpan* span = spanBase->upCastable();
870 if (span && span->segment() != opp && span->containsCoincidence(opp)) { // debug has additional condition since it may be called before inner duplicate points have been deleted
877 // find prior span containing opp segment
886 const SkOpSegment* segment = priorPtT->span()->segment();
910 const SkOpPtT* rootPriorPtT = priorPtT->span()->ptT();
911 const SkOpPtT* rootPtT = ptT->span()->ptT();
912 const SkOpPtT* rootOppStart = oppStart->span()->ptT();
913 const SkOpPtT* rootOppEnd = oppEnd->span()->ptT();
944 // if a span has more than one intersection, merge the other segments' span as needed
957 const SkOpSpanBase* oppSpan = testPtT->span();
1040 // Move nearby t values and pts so they all hang off the same span. Alignment happens later.
1043 // release undeleted spans pointing to this seg that are linked to the primary span
1049 const SkOpSpanBase* test = ptT->span();
1125 const SkOpSpan* span = &fHead;
1127 if (span->done()) {
1130 if (lastId == this->debugID() && lastT == span->t()) {
1134 lastT = span->t();
1138 this->subDivide(span, span->next(), &curvePart);
1147 str->appendf(") t=%1.9g tEnd=%1.9g", span->t(), span->next()->t());
1148 if (span->windSum() == SK_MinS32) {
1151 str->appendf(" windSum=%d", span->windSum());
1153 if (span->oppValue() && span->oppSum() == SK_MinS32) {
1155 } else if (span->oppValue() || span->oppSum() != SK_MinS32) {
1156 str->appendf(" oppSum=%d", span->oppSum());
1158 str->appendf(" windValue=%d", span->windValue());
1159 if (span->oppValue() || span->oppSum() != SK_MinS32) {
1160 str->appendf(" oppValue=%d", span->oppValue());
1163 } while ((span = span->next()->upCastable()));
1168 void SkOpSegment::debugShowNewWinding(const char* fun, const SkOpSpan* span, int winding) {
1169 const SkPoint& pt = span->ptT()->fPt;
1176 span->t(), span->debugID(), pt.fX, pt.fY, span->next()->t());
1183 if (span->windSum() == SK_MinS32) {
1186 SkDebugf("%d", span->windSum());
1188 SkDebugf(" windValue=%d\n", span->windValue());
1191 void SkOpSegment::debugShowNewWinding(const char* fun, const SkOpSpan* span, int winding,
1193 const SkPoint& pt = span->ptT()->fPt;
1200 span->t(), span->debugID(), pt.fX, pt.fY, span->next()->t(), winding, oppWinding);
1213 if (span->oppSum() == SK_MinS32) {
1216 SkDebugf("%d", span->oppSum());
1219 if (span->windSum() == SK_MinS32) {
1222 SkDebugf("%d", span->windSum());
1224 SkDebugf(" windValue=%d oppValue=%d\n", span->windValue(), span->oppValue());
1390 SkASSERT(coinPtTEnd()->span() == over || !SkOpGlobalState::DebugRunFail());
1391 SkASSERT(oppPtTEnd()->span() == outer || !SkOpGlobalState::DebugRunFail());
1396 // sets the span's end to the ptT referenced by the previous-next
1401 const SkOpSpanBase* origSpan = origPtT->span();
1414 // makes all span ends agree with the segment's spans that define them
1429 const SkOpSpan* start = coinPtTStart()->span()->upCast();
1443 const SkOpSpanBase* end = coinPtTEnd()->span();
1475 if (testPtT->span()->ptT() != testPtT) {
1502 oppStart->span()->addOpp(writableBase);
1538 FAIL_IF(!ptT->span()->upCastable(), ptT->span());
1539 const SkOpSpan* base = ptT->span()->upCast();
1541 FAIL_IF(!prev, ptT->span());
1561 coincident pair. If so, check for a new coincident span between B-end/A ptT loop
1565 const SkCoincidentSpans* span = fHead;
1566 if (!span) {
1569 // fTop = span;
1572 if (span->coinPtTStart()->fPt != span->oppPtTStart()->fPt) {
1573 FAIL_IF(1 == span->coinPtTStart()->fT, span);
1574 bool onEnd = span->coinPtTStart()->fT == 0;
1575 bool oOnEnd = zero_or_one(span->oppPtTStart()->fT);
1578 if (this->debugAddEndMovedSpans(log, span->oppPtTStart()), false) {
1583 if (this->debugAddEndMovedSpans(log, span->coinPtTStart()), false) {
1588 if (span->coinPtTEnd()->fPt != span->oppPtTEnd()->fPt) {
1589 bool onEnd = span->coinPtTEnd()->fT == 1;
1590 bool oOnEnd = zero_or_one(span->oppPtTEnd()->fT);
1593 if (this->debugAddEndMovedSpans(log, span->oppPtTEnd()), false) {
1598 if (this->debugAddEndMovedSpans(log, span->coinPtTEnd()), false) {
1603 } while ((span = span->next()));
1610 // if the spans don't match, add the mssing pt to the segment and loop it in the opposite span
1624 const SkOpSpanBase* start = startPtT->span();
1625 const SkOpSpanBase* oStart = oStartPtT->span();
1626 const SkOpSpanBase* end = coin->coinPtTEnd()->span();
1627 const SkOpSpanBase* oEnd = coin->oppPtTEnd()->span();
1656 && walk != coin->coinPtTEnd()->span());
1681 end = coin->coinPtTEnd()->span();
1682 oEnd = coin->oppPtTEnd()->span();
1811 if (cs && os) cs->span()->debugAddOpp(log, os->span());
1821 if (ce && oe) ce->span()->debugAddOpp(log, oe->span());
2031 FAIL_IF(!coin->coinPtTStartWritable()->span()->upCastable(), coin);
2032 const SkOpSpan* start = coin->coinPtTStartWritable()->span()->upCast();
2034 const SkOpSpanBase* end = coin->coinPtTEndWritable()->span();
2036 const SkOpSpanBase* oStart = coin->oppPtTStartWritable()->span();
2038 const SkOpSpanBase* oEnd = coin->oppPtTEndWritable()->span();
2106 const SkCoincidentSpans* span = fHead;
2107 while (span) {
2108 span->debugShow();
2109 span = span->next();
2236 SkASSERT(coin->coinPtTStart()->span()->ptT() == coin->coinPtTStart());
2237 SkASSERT(coin->coinPtTEnd()->span()->ptT() == coin->coinPtTEnd());
2238 SkASSERT(coin->oppPtTStart()->span()->ptT() == coin->oppPtTStart());
2239 SkASSERT(coin->oppPtTEnd()->span()->ptT() == coin->oppPtTEnd());
2259 DebugCheckBetween(coin->coinPtTStart()->span(), coin->coinPtTEnd()->span(),
2262 DebugCheckBetween(coin->oppPtTStart()->span(), coin->oppPtTEnd()->span(),
2354 const SkOpSpanBase* span = &fHead;
2356 span->debugResetCoinT();
2357 } while (!span->final() && (span = span->upCast()->next()));
2358 span = &fHead;
2361 span->debugSetCoinT(index++);
2362 } while (!span->final() && (span = span->upCast()->next()));
2371 const SkOpSpanBase* span = &fHead;
2377 if (!span->final()) {
2379 done += span->upCast()->done() ? 1 : 0;
2381 SkASSERT(span->segment() == this);
2382 SkASSERT(!prev || prev->upCast()->next() == span);
2383 SkASSERT(!prev || prev == span->prev());
2384 prev = span;
2385 double t = span->ptT()->fT;
2388 span->debugValidate();
2389 } while (!span->final() && (span = span->upCast()->next()));
2393 SkASSERT(span->final());
2394 span->debugValidate();
2417 // the insert above may have put both ends of a coincident run in the same span
2419 // this implementation is the motivation for marking that a ptT is referenced by a coincident span
2484 const SkOpSpanBase* testBase = test->span();
2499 const SkOpSpanBase* innerBase = inner->span();
2501 // when the intersection is first detected, the span base is marked if there are
2583 SkASSERT(ptT->span() == this);
2648 const SkOpSpan* span;
2649 const SkOpSpanBase* base = next->span();
2651 const SkOpSpanBase* spanEnd = fNext->contains(segment)->span();
2653 FAIL_IF(!start->span()->upCastable(), this);
2654 span = const_cast<SkOpSpan*>(start->span()->upCast());
2657 span = base->prev();
2658 FAIL_IF(!span, this);
2662 span = base->upCast();
2664 log->record(SkPathOpsDebug::kMarkCoinInsert_Glitch, span);