Home | History | Annotate | Download | only in pathops

Lines Matching defs:span

29 #define FAIL_WITH_NULL_IF(cond, span) \
30 do { if (cond) log->record(SkPathOpsDebug::kFail_Glitch, span); } while (false)
33 #define RETURN_FALSE_IF(cond, span) \
34 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;
391 SkDebugf(" coinSeg/Span/PtT=%d/%d/%d", glitch.fCoinSpan->segment()->debugID(),
392 glitch.fCoinSpan->span()->debugID(), glitch.fCoinSpan->debugID());
398 SkDebugf(" oppSeg/Span/PtT=%d/%d/%d", glitch.fOppSpan->segment()->debugID(),
399 glitch.fOppSpan->span()->debugID(), glitch.fOppSpan->debugID());
750 const SkOpSpanBase* span = &fHead;
752 const SkOpPtT* result = span->ptT();
754 // span->bumpSpanAdds();
758 const SkOpSpan* prev = result->span()->prev();
759 FAIL_WITH_NULL_IF(!prev, span);
760 // marks in global state that new op span has been allocated
762 // span->init(this, prev, t, pt);
766 // span->segment()->debugID(), span->debugID());
768 // span->bumpSpanAdds();
771 FAIL_WITH_NULL_IF(span != &fTail, span);
772 } while ((span = span->upCast()->next()));
781 const SkOpSpan* span;
790 span = base->upCast();
791 angle = span->toAngle();
795 } while ((base = span->next()));
809 const SkOpSpan* span = &fHead;
811 this->debugClearOne(span, glitches);
812 } while ((span = span->next()->upCastable()));
817 void SkOpSegment::debugClearOne(const SkOpSpan* span, SkPathOpsDebug::GlitchLog* glitches) const {
818 if (span->windValue()) glitches->record(SkPathOpsDebug::kCollapsedWindValue_Glitch, span);
819 if (span->oppValue()) glitches->record(SkPathOpsDebug::kCollapsedOppValue_Glitch, span);
820 if (!span->done()) glitches->record(SkPathOpsDebug::kCollapsedDone_Glitch, span);
826 SkOpSpan* span = this->head();
828 if (span->toAngle()) {
830 result = span->toAngle();
832 } while ((span = span->next()->upCastable()));
839 void SkOpSegment::DebugClearVisited(const SkOpSpanBase* span) {
842 const SkOpPtT* ptT = span->ptT(), * stopPtT = ptT;
847 } while (!span->final() && (span = span->upCast()->next()));
871 SkASSERT(ptT->span() == spanBase);
876 const SkOpSegment* opp = ptT->span()->segment();
890 const SkOpSpan* span = spanBase->upCastable();
893 if (span && span->segment() != opp && span->containsCoincidence(opp)) { // debug has additional condition since it may be called before inner duplicate points have been deleted
900 // find prior span containing opp segment
909 const SkOpSegment* segment = priorPtT->span()->segment();
932 const SkOpPtT* rootPriorPtT = priorPtT->span()->ptT();
933 const SkOpPtT* rootPtT = ptT->span()->ptT();
934 const SkOpPtT* rootOppStart = oppStart->span()->ptT();
935 const SkOpPtT* rootOppEnd = oppEnd->span()->ptT();
965 // if a span has more than one intersection, merge the other segments' span as needed
978 const SkOpSpanBase* oppSpan = testPtT->span();
1061 // Move nearby t values and pts so they all hang off the same span. Alignment happens later.
1064 // release undeleted spans pointing to this seg that are linked to the primary span
1070 const SkOpSpanBase* test = ptT->span();
1146 const SkOpSpan* span = &fHead;
1148 if (span->done()) {
1151 if (lastId == this->debugID() && lastT == span->t()) {
1155 lastT = span->t();
1159 this->subDivide(span, span->next(), &curvePart);
1168 str->appendf(") t=%1.9g tEnd=%1.9g", span->t(), span->next()->t());
1169 if (span->windSum() == SK_MinS32) {
1172 str->appendf(" windSum=%d", span->windSum());
1174 if (span->oppValue() && span->oppSum() == SK_MinS32) {
1176 } else if (span->oppValue() || span->oppSum() != SK_MinS32) {
1177 str->appendf(" oppSum=%d", span->oppSum());
1179 str->appendf(" windValue=%d", span->windValue());
1180 if (span->oppValue() || span->oppSum() != SK_MinS32) {
1181 str->appendf(" oppValue=%d", span->oppValue());
1184 } while ((span = span->next()->upCastable()));
1189 void SkOpSegment::debugShowNewWinding(const char* fun, const SkOpSpan* span, int winding) {
1190 const SkPoint& pt = span->ptT()->fPt;
1197 span->t(), span->debugID(), pt.fX, pt.fY, span->next()->t());
1204 if (span->windSum() == SK_MinS32) {
1207 SkDebugf("%d", span->windSum());
1209 SkDebugf(" windValue=%d\n", span->windValue());
1212 void SkOpSegment::debugShowNewWinding(const char* fun, const SkOpSpan* span, int winding,
1214 const SkPoint& pt = span->ptT()->fPt;
1221 span->t(), span->debugID(), pt.fX, pt.fY, span->next()->t(), winding, oppWinding);
1234 if (span->oppSum() == SK_MinS32) {
1237 SkDebugf("%d", span->oppSum());
1240 if (span->windSum() == SK_MinS32) {
1243 SkDebugf("%d", span->windSum());
1245 SkDebugf(" windValue=%d oppValue=%d\n", span->windValue(), span->oppValue());
1411 SkASSERT(coinPtTEnd()->span() == over || !SkOpGlobalState::DebugRunFail());
1412 SkASSERT(oppPtTEnd()->span() == outer || !SkOpGlobalState::DebugRunFail());
1417 // sets the span's end to the ptT referenced by the previous-next
1422 const SkOpSpanBase* origSpan = origPtT->span();
1435 // makes all span ends agree with the segment's spans that define them
1450 const SkOpSpan* start = coinPtTStart()->span()->upCast();
1464 const SkOpSpanBase* end = coinPtTEnd()->span();
1496 if (testPtT->span()->ptT() != testPtT) {
1523 oppStart->span()->addOpp(writableBase);
1557 FAIL_IF(!ptT->span()->upCastable(), ptT->span());
1558 const SkOpSpan* base = ptT->span()->upCast();
1560 FAIL_IF(!prev, ptT->span());
1580 coincident pair. If so, check for a new coincident span between B-end/A ptT loop
1584 const SkCoincidentSpans* span = fHead;
1585 if (!span) {
1588 // fTop = span;
1591 if (span->coinPtTStart()->fPt != span->oppPtTStart()->fPt) {
1592 FAIL_IF(1 == span->coinPtTStart()->fT, span);
1593 bool onEnd = span->coinPtTStart()->fT == 0;
1594 bool oOnEnd = zero_or_one(span->oppPtTStart()->fT);
1597 if (this->debugAddEndMovedSpans(log, span->oppPtTStart()), false) {
1602 if (this->debugAddEndMovedSpans(log, span->coinPtTStart()), false) {
1607 if (span->coinPtTEnd()->fPt != span->oppPtTEnd()->fPt) {
1608 bool onEnd = span->coinPtTEnd()->fT == 1;
1609 bool oOnEnd = zero_or_one(span->oppPtTEnd()->fT);
1612 if (this->debugAddEndMovedSpans(log, span->oppPtTEnd()), false) {
1617 if (this->debugAddEndMovedSpans(log, span->coinPtTEnd()), false) {
1622 } while ((span = span->next()));
1629 // if the spans don't match, add the mssing pt to the segment and loop it in the opposite span
1643 const SkOpSpanBase* start = startPtT->span();
1644 const SkOpSpanBase* oStart = oStartPtT->span();
1645 const SkOpSpanBase* end = coin->coinPtTEnd()->span();
1646 const SkOpSpanBase* oEnd = coin->oppPtTEnd()->span();
1675 && walk != coin->coinPtTEnd()->span());
1700 end = coin->coinPtTEnd()->span();
1701 oEnd = coin->oppPtTEnd()->span();
1827 if (cs && os) cs->span()->debugAddOpp(log, os->span());
1837 if (ce && oe) ce->span()->debugAddOpp(log, oe->span());
2046 FAIL_IF(!coin->coinPtTStartWritable()->span()->upCastable(), coin);
2047 const SkOpSpan* start = coin->coinPtTStartWritable()->span()->upCast();
2049 const SkOpSpanBase* end = coin->coinPtTEndWritable()->span();
2051 const SkOpSpanBase* oStart = coin->oppPtTStartWritable()->span();
2053 const SkOpSpanBase* oEnd = coin->oppPtTEndWritable()->span();
2120 const SkCoincidentSpans* span = fHead;
2121 while (span) {
2122 span->debugShow();
2123 span = span->next();
2246 SkASSERT(coin->coinPtTStart()->span()->ptT() == coin->coinPtTStart());
2247 SkASSERT(coin->coinPtTEnd()->span()->ptT() == coin->coinPtTEnd());
2248 SkASSERT(coin->oppPtTStart()->span()->ptT() == coin->oppPtTStart());
2249 SkASSERT(coin->oppPtTEnd()->span()->ptT() == coin->oppPtTEnd());
2269 DebugCheckBetween(coin->coinPtTStart()->span(), coin->coinPtTEnd()->span(),
2272 DebugCheckBetween(coin->oppPtTStart()->span(), coin->oppPtTEnd()->span(),
2364 const SkOpSpanBase* span = &fHead;
2366 span->debugResetCoinT();
2367 } while (!span->final() && (span = span->upCast()->next()));
2368 span = &fHead;
2371 span->debugSetCoinT(index++);
2372 } while (!span->final() && (span = span->upCast()->next()));
2381 const SkOpSpanBase* span = &fHead;
2387 if (!span->final()) {
2389 done += span->upCast()->done() ? 1 : 0;
2391 SkASSERT(span->segment() == this);
2392 SkASSERT(!prev || prev->upCast()->next() == span);
2393 SkASSERT(!prev || prev == span->prev());
2394 prev = span;
2395 double t = span->ptT()->fT;
2398 span->debugValidate();
2399 } while (!span->final() && (span = span->upCast()->next()));
2403 SkASSERT(span->final());
2404 span->debugValidate();
2427 // the insert above may have put both ends of a coincident run in the same span
2429 // this implementation is the motivation for marking that a ptT is referenced by a coincident span
2494 const SkOpSpanBase* testBase = test->span();
2509 const SkOpSpanBase* innerBase = inner->span();
2511 // when the intersection is first detected, the span base is marked if there are
2593 SkASSERT(ptT->span() == this);
2658 const SkOpSpan* span;
2659 const SkOpSpanBase* base = next->span();
2661 const SkOpSpanBase* spanEnd = fNext->contains(segment)->span();
2663 FAIL_IF(!start->span()->upCastable(), this);
2664 span = const_cast<SkOpSpan*>(start->span()->upCast());
2667 span = base->prev();
2668 FAIL_IF(!span, this);
2672 span = base->upCast();
2674 log->record(SkPathOpsDebug::kMarkCoinInsert_Glitch, span);