Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
PathOpsDebug.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
31#include "tests/PathOpsDebug.h"
32
33#include <algorithm>
34#include <cfloat>
35#include <cmath>
36#include <cstdint>
37
44
45inline void DebugDumpDouble(double x) {
46 if (x == floor(x)) {
47 SkDebugf("%.0f", x);
48 } else {
49 SkDebugf("%1.19g", x);
50 }
51}
52
53inline void DebugDumpFloat(float x) {
54 if (x == floorf(x)) {
55 SkDebugf("%.0f", x);
56 } else {
57 SkDebugf("%1.9gf", x);
58 }
59}
60
61inline void DebugDumpHexFloat(float x) {
62 SkDebugf("SkBits2Float(0x%08x)", SkFloat2Bits(x));
63}
64
65// if not defined by PathOpsDebug.cpp ...
66#if !defined SK_DEBUG && FORCE_RELEASE
67bool SkPathOpsDebug::ValidWind(int wind) {
68 return wind > SK_MinS32 + 0xFFFF && wind < SK_MaxS32 - 0xFFFF;
69}
70
71void SkPathOpsDebug::WindingPrintf(int wind) {
72 if (wind == SK_MinS32) {
73 SkDebugf("?");
74 } else {
75 SkDebugf("%d", wind);
76 }
77}
78#endif
79
80static void DumpID(int id) {
81 SkDebugf("} ");
82 if (id >= 0) {
83 SkDebugf("id=%d", id);
84 }
85 SkDebugf("\n");
86}
87
88void SkDConic::dump() const {
89 dumpInner();
90 SkDebugf("},\n");
91}
92
93void SkDConic::dumpID(int id) const {
94 dumpInner();
95 DumpID(id);
96}
97
98void SkDConic::dumpInner() const {
99 SkDebugf("{");
100 fPts.dumpInner();
101 SkDebugf("}}, %1.9gf", fWeight);
102}
103
104void SkDCubic::dump() const {
105 this->dumpInner();
106 SkDebugf("}},\n");
107}
108
109void SkDCubic::dumpID(int id) const {
110 this->dumpInner();
111 SkDebugf("}");
112 DumpID(id);
113}
114
115static inline bool double_is_NaN(double x) { return x != x; }
116
118 SkDebugf("{{");
119 int index = 0;
120 do {
121 if (index != 0) {
122 if (double_is_NaN(fPts[index].fX) && double_is_NaN(fPts[index].fY)) {
123 return;
124 }
125 SkDebugf(", ");
126 }
127 fPts[index].dump();
128 } while (++index < 3);
129 if (double_is_NaN(fPts[index].fX) && double_is_NaN(fPts[index].fY)) {
130 return;
131 }
132 SkDebugf(", ");
133 fPts[index].dump();
134}
135
136void SkDCurve::dump() const {
137 dumpID(-1);
138}
139
140void SkDCurve::dumpID(int id) const {
141#ifndef SK_RELEASE
142 switch(fVerb) {
144 fLine.dumpID(id);
145 break;
147 fQuad.dumpID(id);
148 break;
150 fConic.dumpID(id);
151 break;
153 fCubic.dumpID(id);
154 break;
155 default:
156 SkASSERT(0);
157 }
158#else
159 fCubic.dumpID(id);
160#endif
161}
162
163void SkDLine::dump() const {
164 this->dumpInner();
165 SkDebugf("}},\n");
166}
167
168void SkDLine::dumpID(int id) const {
169 this->dumpInner();
170 SkDebugf("}");
171 DumpID(id);
172}
173
174void SkDLine::dumpInner() const {
175 SkDebugf("{{");
176 fPts[0].dump();
177 SkDebugf(", ");
178 fPts[1].dump();
179}
180
181void SkDPoint::dump() const {
182 SkDebugf("{");
184 SkDebugf(", ");
186 SkDebugf("}");
187}
188
189void SkDPoint::Dump(const SkPoint& pt) {
190 SkDebugf("{");
191 DebugDumpFloat(pt.fX);
192 SkDebugf(", ");
193 DebugDumpFloat(pt.fY);
194 SkDebugf("}");
195}
196
197void SkDPoint::DumpHex(const SkPoint& pt) {
198 SkDebugf("{");
200 SkDebugf(", ");
202 SkDebugf("}");
203}
204
205void SkDQuad::dump() const {
206 dumpInner();
207 SkDebugf("}},\n");
208}
209
210void SkDQuad::dumpID(int id) const {
211 dumpInner();
212 SkDebugf("}");
213 DumpID(id);
214}
215
216void SkDQuad::dumpInner() const {
217 SkDebugf("{{");
218 int index = 0;
219 do {
220 fPts[index].dump();
221 SkDebugf(", ");
222 } while (++index < 2);
223 fPts[index].dump();
224}
225
227 SkDebugf("used=%d of %d", fUsed, fMax);
228 for (int index = 0; index < fUsed; ++index) {
229 SkDebugf(" t=(%s%1.9g,%s%1.9g) pt=(%1.9g,%1.9g)",
230 fIsCoincident[0] & (1 << index) ? "*" : "", fT[0][index],
231 fIsCoincident[1] & (1 << index) ? "*" : "", fT[1][index],
232 fPt[index].fX, fPt[index].fY);
233 if (index < 2 && fNearlySame[index]) {
234 SkDebugf(" pt2=(%1.9g,%1.9g)",fPt2[index].fX, fPt2[index].fY);
235 }
236 }
237 SkDebugf("\n");
238}
239
240const SkOpAngle* AngleAngle(const SkOpAngle* angle, int id) {
241 return angle->debugAngle(id);
242}
243
245 return angle->debugContour(id);
246}
247
248const SkOpPtT* AnglePtT(const SkOpAngle* angle, int id) {
249 return angle->debugPtT(id);
250}
251
252const SkOpSegment* AngleSegment(const SkOpAngle* angle, int id) {
253 return angle->debugSegment(id);
254}
255
256const SkOpSpanBase* AngleSpan(const SkOpAngle* angle, int id) {
257 return angle->debugSpan(id);
258}
259
261 return contour->debugAngle(id);
262}
263
265 return contour->debugContour(id);
266}
267
269 return contour->debugPtT(id);
270}
271
273 return contour->debugSegment(id);
274}
275
277 return contour->debugSpan(id);
278}
279
281 return coin->debugAngle(id);
282}
283
285 return coin->debugContour(id);
286}
287
289 return coin->debugPtT(id);
290}
291
293 return coin->debugSegment(id);
294}
295
297 return coin->debugSpan(id);
298}
299
300const SkOpAngle* PtTAngle(const SkOpPtT* ptT, int id) {
301 return ptT->debugAngle(id);
302}
303
305 return ptT->debugContour(id);
306}
307
308const SkOpPtT* PtTPtT(const SkOpPtT* ptT, int id) {
309 return ptT->debugPtT(id);
310}
311
312const SkOpSegment* PtTSegment(const SkOpPtT* ptT, int id) {
313 return ptT->debugSegment(id);
314}
315
316const SkOpSpanBase* PtTSpan(const SkOpPtT* ptT, int id) {
317 return ptT->debugSpan(id);
318}
319
320const SkOpAngle* SegmentAngle(const SkOpSegment* span, int id) {
321 return span->debugAngle(id);
322}
323
325 return span->debugContour(id);
326}
327
328const SkOpPtT* SegmentPtT(const SkOpSegment* span, int id) {
329 return span->debugPtT(id);
330}
331
332const SkOpSegment* SegmentSegment(const SkOpSegment* span, int id) {
333 return span->debugSegment(id);
334}
335
336const SkOpSpanBase* SegmentSpan(const SkOpSegment* span, int id) {
337 return span->debugSpan(id);
338}
339
340const SkOpAngle* SpanAngle(const SkOpSpanBase* span, int id) {
341 return span->debugAngle(id);
342}
343
345 return span->debugContour(id);
346}
347
348const SkOpPtT* SpanPtT(const SkOpSpanBase* span, int id) {
349 return span->debugPtT(id);
350}
351
352const SkOpSegment* SpanSegment(const SkOpSpanBase* span, int id) {
353 return span->debugSegment(id);
354}
355
356const SkOpSpanBase* SpanSpan(const SkOpSpanBase* span, int id) {
357 return span->debugSpan(id);
358}
359
360#if DEBUG_COIN
361void SkPathOpsDebug::DumpCoinDict() {
362 SkPathOpsDebug::gCoinSumChangedDict.dump("unused coin algorithm", false);
363 SkPathOpsDebug::gCoinSumVisitedDict.dump("visited coin function", true);
364}
365
366void SkPathOpsDebug::CoinDict::dump(const char* str, bool visitCheck) const {
367 int count = fDict.size();
368 for (int index = 0; index < count; ++index) {
369 const auto& entry = fDict[index];
370 if (visitCheck || entry.fGlitchType == kUninitialized_Glitch) {
371 SkDebugf("%s %s : line %d iteration %d", str, entry.fFunctionName,
372 entry.fLineNumber, entry.fIteration);
373 DumpGlitchType(entry.fGlitchType);
374 SkDebugf("\n");
375 }
376 }
377}
378#endif
379
382 do {
383 contour->dump();
384 } while ((contour = contour->next()));
385}
386
389 do {
390 contour->dumpAll();
391 } while ((contour = contour->next()));
392}
393
396 do {
397 contour->dumpAngles();
398 } while ((contour = contour->next()));
399}
400
403 do {
404 contour->dumpPts();
405 } while ((contour = contour->next()));
406}
407
408void SkOpContour::dumpContoursPt(int segmentID) const {
410 do {
411 contour->dumpPt(segmentID);
412 } while ((contour = contour->next()));
413}
414
415void SkOpContour::dumpContoursSegment(int segmentID) const {
417 do {
418 contour->dumpSegment(segmentID);
419 } while ((contour = contour->next()));
420}
421
422void SkOpContour::dumpContoursSpan(int spanID) const {
424 do {
425 contour->dumpSpan(spanID);
426 } while ((contour = contour->next()));
427}
428
431 do {
432 contour->dumpSpans();
433 } while ((contour = contour->next()));
434}
435
436#ifdef SK_DEBUG
437const SkTSpan* DebugSpan(const SkTSect* sect, int id) {
438 return sect->debugSpan(id);
439}
440
441const SkTSpan* DebugT(const SkTSect* sect, double t) {
442 return sect->debugT(t);
443}
444#endif
445
446void Dump(const SkTSect* sect) {
447 sect->dump();
448}
449
450void DumpBoth(SkTSect* sect1, SkTSect* sect2) {
451 sect1->dumpBoth(sect2);
452}
453
454void DumpBounded(SkTSect* sect1, int id) {
455 sect1->dumpBounded(id);
456}
457
458void DumpBounds(SkTSect* sect1) {
459 sect1->dumpBounds();
460}
461
462void DumpCoin(SkTSect* sect1) {
463 sect1->dumpCoin();
464}
465
467 sect1->dumpCoinCurves();
468}
469
470void DumpCurves(const SkTSect* sect) {
471 sect->dumpCurves();
472}
473
474void Dump(const SkTSpan* span) {
475 span->dump();
476}
477
478void DumpAll(const SkTSpan* span) {
479 span->dumpAll();
480}
481
482void DumpBounded(const SkTSpan* span) {
483 span->dumpBounded(0);
484}
485
486void DumpCoin(const SkTSpan* span) {
487 span->dumpCoin();
488}
489
490static void dumpTestCase(const SkDQuad& quad1, const SkDQuad& quad2, int testNo) {
491 SkDebugf("\n<div id=\"quad%d\">\n", testNo);
492 quad1.dumpInner();
493 SkDebugf("}}, ");
494 quad2.dump();
495 SkDebugf("</div>\n\n");
496}
497
498static void dumpTestTrailer() {
499 SkDebugf("</div>\n\n<script type=\"text/javascript\">\n\n");
500 SkDebugf(" var testDivs = [\n");
501}
502
503static void dumpTestList(int testNo, double min) {
504 SkDebugf(" quad%d,", testNo);
505 if (min > 0) {
506 SkDebugf(" // %1.9g", min);
507 }
508 SkDebugf("\n");
509}
510
511void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo) {
512 SkDebugf("\n");
513 dumpTestCase(quad1, quad2, testNo);
515 dumpTestList(testNo, 0);
516 SkDebugf("\n");
517}
518
519void DumpT(const SkDQuad& quad, double t) {
520 SkDLine line = {{quad.ptAtT(t), quad[0]}};
521 line.dump();
522}
523
524const SkOpAngle* SkOpAngle::debugAngle(int id) const {
525 return this->segment()->debugAngle(id);
526}
527
529 return this->segment()->debugCoincidence();
530}
531
533 return this->segment()->debugContour(id);
534}
535
536const SkOpPtT* SkOpAngle::debugPtT(int id) const {
537 return this->segment()->debugPtT(id);
538}
539
541 return this->segment()->debugSegment(id);
542}
543
545 SkASSERT(fStart->t() != fEnd->t());
546 return fStart->t() < fEnd->t() ? -1 : 1;
547}
548
549const SkOpSpanBase* SkOpAngle::debugSpan(int id) const {
550 return this->segment()->debugSpan(id);
551}
552
553void SkOpAngle::dump() const {
554 dumpOne(true);
555 SkDebugf("\n");
556}
557
558void SkOpAngle::dumpOne(bool functionHeader) const {
559// fSegment->debugValidate();
560 const SkOpSegment* segment = this->segment();
561 const SkOpSpan& mSpan = *fStart->starter(fEnd);
562 if (functionHeader) {
563 SkDebugf("%s ", __FUNCTION__);
564 }
565 SkDebugf("[%d", segment->debugID());
566 SkDebugf("/%d", debugID());
567 SkDebugf("] next=");
568 if (fNext) {
569 SkDebugf("%d", fNext->fStart->segment()->debugID());
570 SkDebugf("/%d", fNext->debugID());
571 } else {
572 SkDebugf("?");
573 }
574 SkDebugf(" sect=%d/%d ", fSectorStart, fSectorEnd);
575 SkDebugf(" s=%1.9g [%d] e=%1.9g [%d]", fStart->t(), fStart->debugID(),
576 fEnd->t(), fEnd->debugID());
577 SkDebugf(" sgn=%d windVal=%d", this->debugSign(), mSpan.windValue());
578
579 SkDebugf(" windSum=");
581 if (mSpan.oppValue() != 0 || mSpan.oppSum() != SK_MinS32) {
582 SkDebugf(" oppVal=%d", mSpan.oppValue());
583 SkDebugf(" oppSum=");
585 }
586 if (mSpan.done()) {
587 SkDebugf(" done");
588 }
589 if (unorderable()) {
590 SkDebugf(" unorderable");
591 }
592 if (segment->operand()) {
593 SkDebugf(" operand");
594 }
595}
596
597void SkOpAngle::dumpTo(const SkOpSegment* segment, const SkOpAngle* to) const {
598 const SkOpAngle* first = this;
599 const SkOpAngle* next = this;
600 const char* indent = "";
601 do {
602 SkDebugf("%s", indent);
603 next->dumpOne(false);
604 if (segment == next->fStart->segment()) {
605 if (this == fNext) {
606 SkDebugf(" << from");
607 }
608 if (to == fNext) {
609 SkDebugf(" << to");
610 }
611 }
612 SkDebugf("\n");
613 indent = " ";
614 next = next->fNext;
615 } while (next && next != first);
616}
617
619 const SkOpAngle* first = this;
620 const SkOpAngle* next = this;
621 do {
622 next->fPart.fCurve.dumpID(next->segment()->debugID());
623 next = next->fNext;
624 } while (next && next != first);
625}
626
628 const SkOpAngle* first = this;
629 const SkOpAngle* next = this;
630 do {
631 next->dumpOne(false);
632 SkDebugf("\n");
633 next = next->fNext;
634 } while (next && next != first);
635}
636
638 const SkOpAngle* first = this;
639 const SkOpAngle* next = this;
640 do {
641 SkDebugf("{ ");
643 segment->dumpPts();
644 SkDebugf(", %d, %1.9g, %1.9g, {} },\n", SkPathOpsVerbToPoints(segment->verb()) + 1,
645 next->start()->t(), next->end()->t());
646 next = next->fNext;
647 } while (next && next != first);
648}
649
650bool SkOpPtT::debugMatchID(int id) const {
651 int limit = this->debugLoopLimit(false);
652 int loop = 0;
653 const SkOpPtT* ptT = this;
654 do {
655 if (ptT->debugID() == id) {
656 return true;
657 }
658 } while ((!limit || ++loop <= limit) && (ptT = ptT->next()) && ptT != this);
659 return false;
660}
661
662const SkOpAngle* SkOpPtT::debugAngle(int id) const {
663 return this->span()->debugAngle(id);
664}
665
667 return this->span()->debugContour(id);
668}
669
671 return this->span()->debugCoincidence();
672}
673
674const SkOpPtT* SkOpPtT::debugPtT(int id) const {
675 return this->span()->debugPtT(id);
676}
677
678const SkOpSegment* SkOpPtT::debugSegment(int id) const {
679 return this->span()->debugSegment(id);
680}
681
682const SkOpSpanBase* SkOpPtT::debugSpan(int id) const {
683 return this->span()->debugSpan(id);
684}
685
686void SkOpPtT::dump() const {
687 SkDebugf("seg=%d span=%d ptT=%d",
688 this->segment()->debugID(), this->span()->debugID(), this->debugID());
689 this->dumpBase();
690 SkDebugf("\n");
691}
692
693void SkOpPtT::dumpAll() const {
694 contour()->indentDump();
695 const SkOpPtT* next = this;
696 int limit = debugLoopLimit(true);
697 int loop = 0;
698 do {
699 SkDebugf("%.*s", contour()->debugIndent(), " ");
700 SkDebugf("seg=%d span=%d ptT=%d",
701 next->segment()->debugID(), next->span()->debugID(), next->debugID());
702 next->dumpBase();
703 SkDebugf("\n");
704 if (limit && ++loop >= limit) {
705 SkDebugf("*** abort loop ***\n");
706 break;
707 }
708 } while ((next = next->fNext) && next != this);
709 contour()->outdentDump();
710}
711
712void SkOpPtT::dumpBase() const {
713 SkDebugf(" t=%1.9g pt=(%1.9g,%1.9g)%s%s%s", this->fT, this->fPt.fX, this->fPt.fY,
714 this->fCoincident ? " coin" : "",
715 this->fDuplicatePt ? " dup" : "", this->fDeleted ? " deleted" : "");
716}
717
719 return this->segment()->debugAngle(id);
720}
721
723 return this->segment()->debugCoincidence();
724}
725
727 return this->segment()->debugContour(id);
728}
729
730const SkOpPtT* SkOpSpanBase::debugPtT(int id) const {
731 return this->segment()->debugPtT(id);
732}
733
735 return this->segment()->debugSegment(id);
736}
737
739 return this->segment()->debugSpan(id);
740}
741
742void SkOpSpanBase::dump() const {
743 this->dumpHead();
744 this->fPtT.dump();
745}
746
748 SkDebugf("%.*s", contour()->debugIndent(), " ");
749 SkDebugf("seg=%d span=%d", this->segment()->debugID(), this->debugID());
750 this->dumpBase();
751 SkDebugf("\n");
752}
753
755 this->dumpHead();
756 this->fPtT.dumpAll();
757}
758
760 if (this->fAligned) {
761 SkDebugf(" aligned");
762 }
763 if (this->fChased) {
764 SkDebugf(" chased");
765 }
766#ifdef SK_DEBUG
767 if (this->fDebugDeleted) {
768 SkDebugf(" deleted");
769 }
770#endif
771 if (!this->final()) {
772 this->upCast()->dumpSpan();
773 }
774 const SkOpSpanBase* coin = this->coinEnd();
775 if (this != coin) {
776 SkDebugf(" coinEnd seg/span=%d/%d", coin->segment()->debugID(), coin->debugID());
777 } else if (this->final() || !this->upCast()->isCoincident()) {
778 const SkOpPtT* oPt = this->ptT()->next();
779 SkDebugf(" seg/span=%d/%d", oPt->segment()->debugID(), oPt->span()->debugID());
780 }
781 SkDebugf(" adds=%d", fSpanAdds);
782}
783
785 const SkOpSpan* span = this->upCastable();
786 if (!span) {
787 return;
788 }
789 if (!span->isCoincident()) {
790 return;
791 }
792 span->dumpCoin();
793}
794
795void SkOpSpan::dumpCoin() const {
796 const SkOpSpan* coincident = fCoincident;
797 bool ok = debugCoinLoopCheck();
798 this->dump();
799 int loop = 0;
800 do {
801 coincident->dump();
802 if (!ok && ++loop > 10) {
803 SkDebugf("*** abort loop ***\n");
804 break;
805 }
806 } while ((coincident = coincident->fCoincident) != this);
807}
808
809bool SkOpSpan::dumpSpan() const {
810 SkOpSpan* coin = fCoincident;
811 if (this != coin) {
812 SkDebugf(" coinStart seg/span=%d/%d", coin->segment()->debugID(), coin->debugID());
813 }
814 SkDebugf(" windVal=%d", this->windValue());
815 SkDebugf(" windSum=");
817 if (this->oppValue() != 0 || this->oppSum() != SK_MinS32) {
818 SkDebugf(" oppVal=%d", this->oppValue());
819 SkDebugf(" oppSum=");
821 }
822 if (this->done()) {
823 SkDebugf(" done");
824 }
825 return this != coin;
826}
827
828const SkOpAngle* SkOpSegment::debugAngle(int id) const {
829 return this->contour()->debugAngle(id);
830}
831
833 return this->contour()->debugCoincidence();
834}
835
837 return this->contour()->debugContour(id);
838}
839
840const SkOpPtT* SkOpSegment::debugPtT(int id) const {
841 return this->contour()->debugPtT(id);
842}
843
845 return this->contour()->debugSegment(id);
846}
847
849 return this->contour()->debugSpan(id);
850}
851
852void SkOpSegment::dump() const {
853 SkDebugf("%.*s", contour()->debugIndent(), " ");
854 this->dumpPts();
855 const SkOpSpanBase* span = &fHead;
856 contour()->indentDump();
857 do {
858 SkDebugf("%.*s span=%d ", contour()->debugIndent(), " ", span->debugID());
859 span->ptT()->dumpBase();
860 span->dumpBase();
861 SkDebugf("\n");
862 } while (!span->final() && (span = span->upCast()->next()));
863 contour()->outdentDump();
864}
865
867 SkDebugf("%.*s", contour()->debugIndent(), " ");
868 this->dumpPts();
869 const SkOpSpanBase* span = &fHead;
870 contour()->indentDump();
871 do {
872 span->dumpAll();
873 } while (!span->final() && (span = span->upCast()->next()));
874 contour()->outdentDump();
875}
876
878 SkDebugf("seg=%d\n", debugID());
879 const SkOpSpanBase* span = &fHead;
880 do {
881 const SkOpAngle* fAngle = span->fromAngle();
882 const SkOpAngle* tAngle = span->final() ? nullptr : span->upCast()->toAngle();
883 if (fAngle) {
884 SkDebugf(" span=%d from=%d ", span->debugID(), fAngle->debugID());
885 fAngle->dumpTo(this, tAngle);
886 }
887 if (tAngle) {
888 SkDebugf(" span=%d to=%d ", span->debugID(), tAngle->debugID());
889 tAngle->dumpTo(this, fAngle);
890 }
891 } while (!span->final() && (span = span->upCast()->next()));
892}
893
895 const SkOpSpan* span = &fHead;
896 do {
897 span->dumpCoin();
898 } while ((span = span->next()->upCastable()));
899}
900
901void SkOpSegment::dumpPtsInner(const char* prefix) const {
902 int last = SkPathOpsVerbToPoints(fVerb);
903 SkDebugf("%s=%d {{", prefix, this->debugID());
904 if (fVerb == SkPath::kConic_Verb) {
905 SkDebugf("{");
906 }
907 int index = 0;
908 do {
909 SkDPoint::Dump(fPts[index]);
910 SkDebugf(", ");
911 } while (++index < last);
912 SkDPoint::Dump(fPts[index]);
913 SkDebugf("}}");
914 if (fVerb == SkPath::kConic_Verb) {
915 SkDebugf(", %1.9gf}", fWeight);
916 }
917}
918
919void SkOpSegment::dumpPts(const char* prefix) const {
920 dumpPtsInner(prefix);
921 SkDebugf("\n");
922}
923
925 SkDebugf("- seg=%d span=%d ptT=%d ", fCoinPtTStart->segment()->debugID(),
926 fCoinPtTStart->span()->debugID(), fCoinPtTStart->debugID());
927 fCoinPtTStart->dumpBase();
928 SkDebugf(" span=%d ptT=%d ", fCoinPtTEnd->span()->debugID(), fCoinPtTEnd->debugID());
929 fCoinPtTEnd->dumpBase();
930 if (fCoinPtTStart->segment()->operand()) {
931 SkDebugf(" operand");
932 }
933 if (fCoinPtTStart->segment()->isXor()) {
934 SkDebugf(" xor");
935 }
936 SkDebugf("\n");
937 SkDebugf("+ seg=%d span=%d ptT=%d ", fOppPtTStart->segment()->debugID(),
938 fOppPtTStart->span()->debugID(), fOppPtTStart->debugID());
939 fOppPtTStart->dumpBase();
940 SkDebugf(" span=%d ptT=%d ", fOppPtTEnd->span()->debugID(), fOppPtTEnd->debugID());
941 fOppPtTEnd->dumpBase();
942 if (fOppPtTStart->segment()->operand()) {
943 SkDebugf(" operand");
944 }
945 if (fOppPtTStart->segment()->isXor()) {
946 SkDebugf(" xor");
947 }
948 SkDebugf("\n");
949}
950
952 SkCoincidentSpans* span = fHead;
953 while (span) {
954 span->dump();
955 span = span->next();
956 }
957 if (!fTop || fHead == fTop) {
958 return;
959 }
960 SkDebugf("top:\n");
961 span = fTop;
962 int count = 0;
963 while (span) {
964 span->dump();
965 span = span->next();
966 SkCoincidentSpans* check = fTop;
967 ++count;
968 for (int index = 0; index < count; ++index) {
969 if (span == check) {
970 SkDebugf("(loops to #%d)\n", index);
971 return;
972 }
973 check = check->next();
974 }
975 }
976}
977
978void SkOpContour::dump() const {
979 SkDebugf("contour=%d count=%d op=%d xor=%d\n", this->debugID(), fCount, fOperand, fXor);
980 if (!fCount) {
981 return;
982 }
983 const SkOpSegment* segment = &fHead;
984 SkDEBUGCODE(fDebugIndent = 0);
985 this->indentDump();
986 do {
987 segment->dump();
988 } while ((segment = segment->next()));
989 this->outdentDump();
990}
991
993 SkDebugf("contour=%d count=%d op=%d xor=%d\n", this->debugID(), fCount, fOperand, fXor);
994 if (!fCount) {
995 return;
996 }
997 const SkOpSegment* segment = &fHead;
998 SkDEBUGCODE(fDebugIndent = 0);
999 this->indentDump();
1000 do {
1001 segment->dumpAll();
1002 } while ((segment = segment->next()));
1003 this->outdentDump();
1004}
1005
1006
1008 SkDebugf("contour=%d\n", this->debugID());
1009 const SkOpSegment* segment = &fHead;
1010 do {
1011 SkDebugf(" seg=%d ", segment->debugID());
1012 segment->dumpAngles();
1013 } while ((segment = segment->next()));
1014}
1015
1016void SkOpContour::dumpPt(int index) const {
1017 const SkOpSegment* segment = &fHead;
1018 do {
1019 if (segment->debugID() == index) {
1020 segment->dumpPts();
1021 }
1022 } while ((segment = segment->next()));
1023}
1024
1025void SkOpContour::dumpPts(const char* prefix) const {
1026 SkDebugf("contour=%d\n", this->debugID());
1027 const SkOpSegment* segment = &fHead;
1028 do {
1029 SkDebugf(" %s=%d ", prefix, segment->debugID());
1030 segment->dumpPts(prefix);
1031 } while ((segment = segment->next()));
1032}
1033
1034void SkOpContour::dumpPtsX(const char* prefix) const {
1035 if (!this->fCount) {
1036 SkDebugf("<empty>\n");
1037 return;
1038 }
1039 const SkOpSegment* segment = &fHead;
1040 do {
1041 segment->dumpPts(prefix);
1042 } while ((segment = segment->next()));
1043}
1044
1045void SkOpContour::dumpSegment(int index) const {
1046 debugSegment(index)->dump();
1047}
1048
1049void SkOpContour::dumpSegments(const char* prefix, SkPathOp op) const {
1050 bool firstOp = false;
1051 const SkOpContour* c = this;
1052 do {
1053 if (!firstOp && c->operand()) {
1054#if DEBUG_ACTIVE_OP
1055 SkDebugf("op %s\n", SkPathOpsDebug::kPathOpStr[op]);
1056#endif
1057 firstOp = true;
1058 }
1059 c->dumpPtsX(prefix);
1060 } while ((c = c->next()));
1061}
1062
1063void SkOpContour::dumpSpan(int index) const {
1064 debugSpan(index)->dump();
1065}
1066
1068 SkDebugf("contour=%d\n", this->debugID());
1069 const SkOpSegment* segment = &fHead;
1070 do {
1071 SkDebugf(" seg=%d ", segment->debugID());
1072 segment->dump();
1073 } while ((segment = segment->next()));
1074}
1075
1076void SkOpCurve::dump() const {
1078 SkDebugf("{{");
1079 int index;
1080 for (index = 0; index <= count - 1; ++index) {
1081 SkDebugf("{%1.9gf,%1.9gf}, ", fPts[index].fX, fPts[index].fY);
1082 }
1083 SkDebugf("{%1.9gf,%1.9gf}}}\n", fPts[index].fX, fPts[index].fY);
1084}
1085
1086#ifdef SK_DEBUG
1087const SkOpAngle* SkOpGlobalState::debugAngle(int id) const {
1088 const SkOpContour* contour = fContourHead;
1089 do {
1090 const SkOpSegment* segment = contour->first();
1091 while (segment) {
1092 const SkOpSpan* span = segment->head();
1093 do {
1094 SkOpAngle* angle = span->fromAngle();
1095 if (angle && angle->debugID() == id) {
1096 return angle;
1097 }
1098 angle = span->toAngle();
1099 if (angle && angle->debugID() == id) {
1100 return angle;
1101 }
1102 } while ((span = span->next()->upCastable()));
1103 const SkOpSpanBase* tail = segment->tail();
1104 SkOpAngle* angle = tail->fromAngle();
1105 if (angle && angle->debugID() == id) {
1106 return angle;
1107 }
1108 segment = segment->next();
1109 }
1110 } while ((contour = contour->next()));
1111 return nullptr;
1112}
1113
1114SkOpContour* SkOpGlobalState::debugContour(int id) const {
1115 SkOpContour* contour = fContourHead;
1116 do {
1117 if (contour->debugID() == id) {
1118 return contour;
1119 }
1120 } while ((contour = contour->next()));
1121 return nullptr;
1122}
1123
1124const SkOpPtT* SkOpGlobalState::debugPtT(int id) const {
1125 const SkOpContour* contour = fContourHead;
1126 do {
1127 const SkOpSegment* segment = contour->first();
1128 while (segment) {
1129 const SkOpSpan* span = segment->head();
1130 do {
1131 const SkOpPtT* ptT = span->ptT();
1132 if (ptT->debugMatchID(id)) {
1133 return ptT;
1134 }
1135 } while ((span = span->next()->upCastable()));
1136 const SkOpSpanBase* tail = segment->tail();
1137 const SkOpPtT* ptT = tail->ptT();
1138 if (ptT->debugMatchID(id)) {
1139 return ptT;
1140 }
1141 segment = segment->next();
1142 }
1143 } while ((contour = contour->next()));
1144 return nullptr;
1145}
1146
1147const SkOpSegment* SkOpGlobalState::debugSegment(int id) const {
1148 const SkOpContour* contour = fContourHead;
1149 do {
1150 const SkOpSegment* segment = contour->first();
1151 while (segment) {
1152 if (segment->debugID() == id) {
1153 return segment;
1154 }
1155 segment = segment->next();
1156 }
1157 } while ((contour = contour->next()));
1158 return nullptr;
1159}
1160
1161const SkOpSpanBase* SkOpGlobalState::debugSpan(int id) const {
1162 const SkOpContour* contour = fContourHead;
1163 do {
1164 const SkOpSegment* segment = contour->first();
1165 while (segment) {
1166 const SkOpSpan* span = segment->head();
1167 do {
1168 if (span->debugID() == id) {
1169 return span;
1170 }
1171 } while ((span = span->next()->upCastable()));
1172 const SkOpSpanBase* tail = segment->tail();
1173 if (tail->debugID() == id) {
1174 return tail;
1175 }
1176 segment = segment->next();
1177 }
1178 } while ((contour = contour->next()));
1179 return nullptr;
1180}
1181#endif
1182
1184 if (!!fMatch != fMatch) {
1185 return '?';
1186 }
1187 return fMatch ? '*' : 0;
1188}
1189
1191 SkDebugf("t=%1.9g pt=(%1.9g,%1.9g)%s\n", fPerpT, fPerpPt.fX, fPerpPt.fY,
1192 fMatch ? " match" : "");
1193}
1194
1195#ifdef SK_DEBUG
1196
1197const SkTSpan* SkTSect::debugSpan(int id) const {
1198 const SkTSpan* test = fHead;
1199 do {
1200 if (test->debugID() == id) {
1201 return test;
1202 }
1203 } while ((test = test->next()));
1204 return nullptr;
1205}
1206
1207const SkTSpan* SkTSect::debugT(double t) const {
1208 const SkTSpan* test = fHead;
1209 const SkTSpan* closest = nullptr;
1210 double bestDist = DBL_MAX;
1211 do {
1212 if (between(test->fStartT, t, test->fEndT)) {
1213 return test;
1214 }
1215 double testDist = std::min(fabs(test->fStartT - t), fabs(test->fEndT - t));
1216 if (bestDist > testDist) {
1217 bestDist = testDist;
1218 closest = test;
1219 }
1220 } while ((test = test->next()));
1221 SkASSERT(closest);
1222 return closest;
1223}
1224
1225#endif
1226
1227void SkTSect::dump() const {
1228 dumpCommon(fHead);
1229}
1230
1231extern int gDumpTSectNum;
1232
1233void SkTSect::dumpBoth(SkTSect* opp) const {
1234#if DEBUG_T_SECT_DUMP <= 2
1235#if DEBUG_T_SECT_DUMP == 2
1236 SkDebugf("%d ", ++gDumpTSectNum);
1237#endif
1238 this->dump();
1239 SkDebugf("\n");
1240 opp->dump();
1241 SkDebugf("\n");
1242#elif DEBUG_T_SECT_DUMP == 3
1243 SkDebugf("<div id=\"sect%d\">\n", ++gDumpTSectNum);
1244 if (this->fHead) {
1245 this->dumpCurves();
1246 }
1247 if (opp->fHead) {
1248 opp->dumpCurves();
1249 }
1250 SkDebugf("</div>\n\n");
1251#endif
1252}
1253
1254void SkTSect::dumpBounded(int id) const {
1255#ifdef SK_DEBUG
1256 const SkTSpan* bounded = debugSpan(id);
1257 if (!bounded) {
1258 SkDebugf("no span matches %d\n", id);
1259 return;
1260 }
1261 const SkTSpan* test = bounded->debugOpp()->fHead;
1262 do {
1263 if (test->findOppSpan(bounded)) {
1264 test->dump();
1265 SkDebugf(" ");
1266 }
1267 } while ((test = test->next()));
1268 SkDebugf("\n");
1269#endif
1270}
1271
1273 const SkTSpan* test = fHead;
1274 do {
1275 test->dumpBounds();
1276 } while ((test = test->next()));
1277}
1278
1279void SkTSect::dumpCoin() const {
1280 dumpCommon(fCoincident);
1281}
1282
1284 dumpCommonCurves(fCoincident);
1285}
1286
1287void SkTSect::dumpCommon(const SkTSpan* test) const {
1288 SkDebugf("id=%d", debugID());
1289 if (!test) {
1290 SkDebugf(" (empty)");
1291 return;
1292 }
1293 do {
1294 SkDebugf(" ");
1295 test->dump();
1296 } while ((test = test->next()));
1297}
1298
1299void SkTSect::dumpCommonCurves(const SkTSpan* test) const {
1300#if DEBUG_T_SECT
1301 do {
1302 test->fPart->dumpID(test->debugID());
1303 } while ((test = test->next()));
1304#endif
1305}
1306
1308 dumpCommonCurves(fHead);
1309}
1310
1311#ifdef SK_DEBUG
1312
1313const SkTSpan* SkTSpan::debugSpan(int id) const {
1314 return fDebugSect->debugSpan(id);
1315}
1316
1317const SkTSpan* SkTSpan::debugT(double t) const {
1318 return fDebugSect->debugT(t);
1319}
1320
1321#endif
1322
1323void SkTSpan::dumpAll() const {
1324 dumpID();
1325 SkDebugf("=(%g,%g) [", fStartT, fEndT);
1326 const SkTSpanBounded* testBounded = fBounded;
1327 while (testBounded) {
1328 const SkTSpan* span = testBounded->fBounded;
1329 const SkTSpanBounded* next = testBounded->fNext;
1330 span->dumpID();
1331 SkDebugf("=(%g,%g)", span->fStartT, span->fEndT);
1332 if (next) {
1333 SkDebugf(" ");
1334 }
1335 testBounded = next;
1336 }
1337 SkDebugf("]\n");
1338}
1339
1340void SkTSpan::dump() const {
1341 dumpID();
1342 SkDebugf("=(%g,%g) [", fStartT, fEndT);
1343 const SkTSpanBounded* testBounded = fBounded;
1344 while (testBounded) {
1345 const SkTSpan* span = testBounded->fBounded;
1346 const SkTSpanBounded* next = testBounded->fNext;
1347 span->dumpID();
1348 if (next) {
1349 SkDebugf(",");
1350 }
1351 testBounded = next;
1352 }
1353 SkDebugf("]");
1354}
1355
1356void SkTSpan::dumpBounded(int id) const {
1357 SkDEBUGCODE(fDebugSect->dumpBounded(id));
1358}
1359
1361 dumpID();
1362 SkDebugf(" bounds=(%1.9g,%1.9g, %1.9g,%1.9g) boundsMax=%1.9g%s\n",
1363 fBounds.fLeft, fBounds.fTop, fBounds.fRight, fBounds.fBottom, fBoundsMax,
1364 fCollapsed ? " collapsed" : "");
1365}
1366
1367void SkTSpan::dumpCoin() const {
1368 dumpID();
1369 SkDebugf(" coinStart ");
1370 fCoinStart.dump();
1371 SkDebugf(" coinEnd ");
1372 fCoinEnd.dump();
1373}
1374
1375void SkTSpan::dumpID() const {
1376 char cS = fCoinStart.dumpIsCoincidentStr();
1377 if (cS) {
1378 SkDebugf("%c", cS);
1379 }
1380 SkDebugf("%d", debugID());
1381 char cE = fCoinEnd.dumpIsCoincidentStr();
1382 if (cE) {
1383 SkDebugf("%c", cE);
1384 }
1385}
1386
1387#if DEBUG_T_SECT_DUMP > 1
1388int gDumpTSectNum;
1389#endif
1390
1391// global path dumps for msvs Visual Studio 17 to use from Immediate Window
1393 contour.dump();
1394}
1395
1397 contour.dumpAll();
1398}
1399
1401 contour.dumpAngles();
1402}
1403
1405 contour.dumpContours();
1406}
1407
1409 contour.dumpContoursAll();
1410}
1411
1413 contour.dumpContoursAngles();
1414}
1415
1417 contour.dumpContoursPts();
1418}
1419
1420void DumpContoursPt(const SkOpContour& contour, int segmentID) {
1421 contour.dumpContoursPt(segmentID);
1422}
1423
1424void DumpContoursSegment(const SkOpContour& contour, int segmentID) {
1425 contour.dumpContoursSegment(segmentID);
1426}
1427
1428void DumpContoursSpan(const SkOpContour& contour, int segmentID) {
1429 contour.dumpContoursSpan(segmentID);
1430}
1431
1433 contour.dumpContoursSpans();
1434}
1435
1436void DumpPt(const SkOpContour& contour, int pt) {
1437 contour.dumpPt(pt);
1438}
1439
1440void DumpPts(const SkOpContour& contour, const char* prefix) {
1441 contour.dumpPts(prefix);
1442}
1443
1444void DumpSegment(const SkOpContour& contour, int seg) {
1445 contour.dumpSegment(seg);
1446}
1447
1448void DumpSegments(const SkOpContour& contour, const char* prefix, SkPathOp op) {
1449 contour.dumpSegments(prefix, op);
1450}
1451
1452void DumpSpan(const SkOpContour& contour, int span) {
1453 contour.dumpSpan(span);
1454}
1455
1457 contour.dumpSpans();
1458}
1459
1460void Dump(const SkOpSegment& segment) {
1461 segment.dump();
1462}
1463
1464void DumpAll(const SkOpSegment& segment) {
1465 segment.dumpAll();
1466}
1467
1468void DumpAngles(const SkOpSegment& segment) {
1469 segment.dumpAngles();
1470}
1471
1472void DumpCoin(const SkOpSegment& segment) {
1473 segment.dumpCoin();
1474}
1475
1476void DumpPts(const SkOpSegment& segment, const char* prefix) {
1477 segment.dumpPts(prefix);
1478}
1479
1480void Dump(const SkOpPtT& ptT) {
1481 ptT.dump();
1482}
1483
1484void DumpAll(const SkOpPtT& ptT) {
1485 ptT.dumpAll();
1486}
1487
1488void Dump(const SkOpSpanBase& spanBase) {
1489 spanBase.dump();
1490}
1491
1492void DumpCoin(const SkOpSpanBase& spanBase) {
1493 spanBase.dumpCoin();
1494}
1495
1496void DumpAll(const SkOpSpanBase& spanBase) {
1497 spanBase.dumpAll();
1498}
1499
1500void DumpCoin(const SkOpSpan& span) {
1501 span.dumpCoin();
1502}
1503
1504bool DumpSpan(const SkOpSpan& span) {
1505 return span.dumpSpan();
1506}
1507
1508void Dump(const SkDConic& conic) {
1509 conic.dump();
1510}
1511
1512void DumpID(const SkDConic& conic, int id) {
1513 conic.dumpID(id);
1514}
1515
1516void Dump(const SkDCubic& cubic) {
1517 cubic.dump();
1518}
1519
1520void DumpID(const SkDCubic& cubic, int id) {
1521 cubic.dumpID(id);
1522}
1523
1524void Dump(const SkDLine& line) {
1525 line.dump();
1526}
1527
1528void DumpID(const SkDLine& line, int id) {
1529 line.dumpID(id);
1530}
1531
1532void Dump(const SkDQuad& quad) {
1533 quad.dump();
1534}
1535
1536void DumpID(const SkDQuad& quad, int id) {
1537 quad.dumpID(id);
1538}
1539
1540void Dump(const SkDPoint& point) {
1541 point.dump();
1542}
1543
1544void Dump(const SkOpAngle& angle) {
1545 angle.dump();
1546}
1547
1548void SkOpSegment::debugAddAngle(double startT, double endT) {
1549 SkOpPtT* startPtT = startT == 0 ? fHead.ptT() : startT == 1 ? fTail.ptT()
1550 : this->addT(startT);
1551 SkOpPtT* endPtT = endT == 0 ? fHead.ptT() : endT == 1 ? fTail.ptT()
1552 : this->addT(endT);
1553 SkOpAngle* angle = this->globalState()->allocator()->make<SkOpAngle>();
1554 SkOpSpanBase* startSpan = &fHead;
1555 while (startSpan->ptT() != startPtT) {
1556 startSpan = startSpan->upCast()->next();
1557 }
1558 SkOpSpanBase* endSpan = &fHead;
1559 while (endSpan->ptT() != endPtT) {
1560 endSpan = endSpan->upCast()->next();
1561 }
1562 angle->set(startSpan, endSpan);
1563 if (startT < endT) {
1564 startSpan->upCast()->setToAngle(angle);
1565 endSpan->setFromAngle(angle);
1566 } else {
1567 endSpan->upCast()->setToAngle(angle);
1568 startSpan->setFromAngle(angle);
1569 }
1570}
#define test(name)
int count
static bool coincident(const SkPoint &a, const SkPoint &b)
SkOpContour * CoincidenceContour(SkOpCoincidence *coin, int id)
void DumpContoursAll(const SkOpContour &contour)
void DumpQ(const SkDQuad &quad1, const SkDQuad &quad2, int testNo)
void DumpContoursSpans(const SkOpContour &contour)
const SkOpSegment * ContourSegment(SkOpContour *contour, int id)
const SkOpSegment * SpanSegment(const SkOpSpanBase *span, int id)
void DumpPts(const SkOpContour &contour, const char *prefix)
void DumpSpans(const SkOpContour &contour)
void DumpT(const SkDQuad &quad, double t)
const SkOpSpanBase * AngleSpan(const SkOpAngle *angle, int id)
const SkOpPtT * SpanPtT(const SkOpSpanBase *span, int id)
void DumpContoursSegment(const SkOpContour &contour, int segmentID)
const SkOpSpanBase * SegmentSpan(const SkOpSegment *span, int id)
static void dumpTestTrailer()
void DumpContours(const SkOpContour &contour)
void Dump(const SkTSect *sect)
const SkOpSpanBase * PtTSpan(const SkOpPtT *ptT, int id)
const SkOpSpanBase * ContourSpan(SkOpContour *contour, int id)
const SkOpSegment * PtTSegment(const SkOpPtT *ptT, int id)
SkOpContour * SpanContour(SkOpSpanBase *span, int id)
const SkOpAngle * AngleAngle(const SkOpAngle *angle, int id)
const SkOpAngle * PtTAngle(const SkOpPtT *ptT, int id)
SkOpContour * ContourContour(SkOpContour *contour, int id)
static void DumpID(int id)
const SkOpSegment * AngleSegment(const SkOpAngle *angle, int id)
const SkOpPtT * CoincidencePtT(SkOpCoincidence *coin, int id)
void DumpCoin(SkTSect *sect1)
void DumpContoursAngles(const SkOpContour &contour)
void DumpAngles(const SkOpContour &contour)
void DumpSegment(const SkOpContour &contour, int seg)
void DumpCoinCurves(SkTSect *sect1)
const SkOpAngle * CoincidenceAngle(SkOpCoincidence *coin, int id)
void DebugDumpDouble(double x)
int gDumpTSectNum
const SkOpPtT * AnglePtT(const SkOpAngle *angle, int id)
const SkOpSegment * CoincidenceSegment(SkOpCoincidence *coin, int id)
const SkOpAngle * ContourAngle(SkOpContour *contour, int id)
const SkOpPtT * PtTPtT(const SkOpPtT *ptT, int id)
void DumpBounds(SkTSect *sect1)
const SkOpPtT * ContourPtT(SkOpContour *contour, int id)
void DumpPt(const SkOpContour &contour, int pt)
static void dumpTestList(int testNo, double min)
void DumpSpan(const SkOpContour &contour, int span)
static void dumpTestCase(const SkDQuad &quad1, const SkDQuad &quad2, int testNo)
SkOpContour * PtTContour(SkOpPtT *ptT, int id)
const SkOpSpanBase * SpanSpan(const SkOpSpanBase *span, int id)
void DebugDumpFloat(float x)
void DumpSegments(const SkOpContour &contour, const char *prefix, SkPathOp op)
void DumpContoursPts(const SkOpContour &contour)
void DebugDumpHexFloat(float x)
SkOpContour * AngleContour(SkOpAngle *angle, int id)
SkOpContour * SegmentContour(SkOpSegment *span, int id)
void DumpContoursSpan(const SkOpContour &contour, int segmentID)
void DumpBounded(SkTSect *sect1, int id)
const SkOpAngle * SegmentAngle(const SkOpSegment *span, int id)
void DumpAll(const SkTSpan *span)
const SkOpPtT * SegmentPtT(const SkOpSegment *span, int id)
const SkOpSpanBase * CoincidenceSpan(SkOpCoincidence *coin, int id)
static bool double_is_NaN(double x)
const SkOpAngle * SpanAngle(const SkOpSpanBase *span, int id)
const SkOpSegment * SegmentSegment(const SkOpSegment *span, int id)
void DumpBoth(SkTSect *sect1, SkTSect *sect2)
void DumpCurves(const SkTSect *sect)
void DumpContoursPt(const SkOpContour &contour, int segmentID)
#define check(reporter, ref, unref, make, kill)
#define SkASSERT(cond)
Definition SkAssert.h:116
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define SkDEBUGCODE(...)
Definition SkDebug.h:23
static uint32_t SkFloat2Bits(float value)
Definition SkFloatBits.h:41
static bool between(SkScalar a, SkScalar b, SkScalar c)
static bool ok(int result)
static constexpr int32_t SK_MinS32
Definition SkMath.h:22
static constexpr int32_t SK_MaxS32
Definition SkMath.h:21
void DumpID(const SkDConic &, int id)
#define SkDEBUGRELEASE(a, b)
int SkPathOpsVerbToPoints(SkPath::Verb verb)
SkPathOp
Definition SkPathOps.h:22
static FILE * gOut
static bool gCheckForDuplicateNames
static bool gOutputSVG
static bool gJson
static bool gMarkJsonFlaky
static bool gOutFirst
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
SkCoincidentSpans * next()
void dump() const
bool unorderable() const
Definition SkOpAngle.h:104
SkOpSegment * segment() const
SkOpSpanBase * end() const
Definition SkOpAngle.h:73
const SkOpAngle * debugAngle(int id) const
SkOpAngle * next() const
Definition SkOpAngle.h:82
void dumpCurves() const
void dumpOne(bool functionHeader) const
const SkOpSegment * debugSegment(int id) const
SkOpContour * debugContour(int id) const
const SkOpCoincidence * debugCoincidence() const
int debugID() const
Definition SkOpAngle.h:45
void dumpTo(const SkOpSegment *fromSeg, const SkOpAngle *) const
void dumpLoop() const
int debugSign() const
void set(SkOpSpanBase *start, SkOpSpanBase *end)
SkOpSpanBase * start() const
Definition SkOpAngle.h:94
const SkOpSpanBase * debugSpan(int id) const
void dumpTest() const
void dump() const
const SkOpPtT * debugPtT(int id) const
SkOpContour * debugContour(int id) const
const SkOpPtT * debugPtT(int id) const
const SkOpSpanBase * debugSpan(int id) const
const SkOpSegment * debugSegment(int id) const
const SkOpAngle * debugAngle(int id) const
void dump() const
SkOpGlobalState * globalState() const
void dumpPt(int) const
bool operand() const
const SkOpSegment * debugSegment(int id) const
void dumpAll() const
void dumpAngles() const
void dumpContoursAngles() const
const SkOpCoincidence * debugCoincidence() const
const SkOpSpanBase * debugSpan(int id) const
void dump() const
SkOpContour * debugContour(int id) const
void dumpContoursPts() const
void dumpSpan(int) const
void dumpContoursAll() const
void indentDump() const
void dumpContoursSpans() const
void dumpPts(const char *prefix="seg") const
void dumpSegments(const char *prefix="seg", SkPathOp op=(SkPathOp) -1) const
void dumpContours() const
void dumpSegment(int) const
void dumpSpans() const
void dumpContoursPt(int segmentID) const
void outdentDump() const
int debugID() const
Definition SkOpContour.h:88
SkOpContour * next()
const SkOpAngle * debugAngle(int id) const
Definition SkOpContour.h:96
SkOpSegment fHead
void dumpPtsX(const char *prefix) const
void dumpContoursSpan(int segmentID) const
const SkOpPtT * debugPtT(int id) const
void dumpContoursSegment(int segmentID) const
SkArenaAlloc * allocator()
SkOpContourHead * contourHead()
const SkOpSpanBase * span() const
Definition SkOpSpan.h:154
void dump() const
SkPoint fPt
Definition SkOpSpan.h:167
bool fDeleted
Definition SkOpSpan.h:171
const SkOpPtT * next() const
Definition SkOpSpan.h:93
double fT
Definition SkOpSpan.h:166
int debugLoopLimit(bool report) const
const SkOpCoincidence * debugCoincidence() const
const SkOpSpanBase * debugSpan(int id) const
int debugID() const
Definition SkOpSpan.h:50
const SkOpSegment * segment() const
Definition SkOpSpan.cpp:144
bool fDuplicatePt
Definition SkOpSpan.h:172
bool debugMatchID(int id) const
const SkOpPtT * debugPtT(int id) const
SkOpContour * contour() const
Definition SkOpSpan.cpp:83
void dumpBase() const
SkOpContour * debugContour(int id) const
SkOpPtT * fNext
Definition SkOpSpan.h:170
void dumpAll() const
const SkOpSegment * debugSegment(int id) const
const SkOpAngle * debugAngle(int id) const
SkOpContour * debugContour(int id) const
void dumpPtsInner(const char *prefix="seg") const
const SkOpPtT * debugPtT(int id) const
void dumpAngles() const
SkPath::Verb verb() const
bool operand() const
void dumpCoin() const
const SkOpCoincidence * debugCoincidence() const
const SkOpSpanBase * tail() const
void dump() const
int debugID() const
SkOpGlobalState * globalState() const
SkOpPtT * addT(double t)
const SkOpSpan * head() const
void debugAddAngle(double startT, double endT)
const SkOpSpanBase * debugSpan(int id) const
const SkOpAngle * debugAngle(int id) const
bool isXor() const
void dumpPts(const char *prefix="seg") const
SkOpSegment * next() const
void dumpAll() const
const SkOpSegment * debugSegment(int id) const
SkOpContour * contour() const
bool fAligned
Definition SkOpSpan.h:411
const SkOpAngle * debugAngle(int id) const
const SkOpSpanBase * coinEnd() const
Definition SkOpSpan.h:198
SkOpPtT fPtT
Definition SkOpSpan.h:405
const SkOpCoincidence * debugCoincidence() const
void setFromAngle(SkOpAngle *angle)
Definition SkOpSpan.h:330
SkOpContour * contour() const
Definition SkOpSpan.cpp:235
void dumpHead() const
const SkOpSegment * debugSegment(int id) const
SkOpAngle * fromAngle() const
Definition SkOpSpan.h:275
int debugID() const
Definition SkOpSpan.h:224
const SkOpSpanBase * debugSpan(int id) const
SkOpContour * debugContour(int id) const
void dumpBase() const
void dumpCoin() const
bool final() const
Definition SkOpSpan.h:271
const SkOpPtT * debugPtT(int id) const
void dump() const
void dumpAll() const
const SkOpSpan * starter(const SkOpSpanBase *end) const
Definition SkOpSpan.h:347
double t() const
Definition SkOpSpan.h:375
SkOpSpan * upCastable()
Definition SkOpSpan.h:393
SkOpSpan * upCast()
Definition SkOpSpan.h:383
SkOpSegment * segment() const
Definition SkOpSpan.h:318
const SkOpPtT * ptT() const
Definition SkOpSpan.h:310
void setToAngle(SkOpAngle *angle)
Definition SkOpSpan.h:533
int windSum() const
Definition SkOpSpan.h:555
SkOpSpanBase * next() const
Definition SkOpSpan.h:495
void dumpCoin() const
int oppValue() const
Definition SkOpSpan.h:505
int oppSum() const
Definition SkOpSpan.h:500
bool isCoincident() const
Definition SkOpSpan.h:486
bool done() const
Definition SkOpSpan.h:459
SkOpAngle * toAngle() const
Definition SkOpSpan.h:550
bool debugCoinLoopCheck() const
bool dumpSpan() const
int windValue() const
Definition SkOpSpan.h:560
static bool ValidWind(int winding)
static void WindingPrintf(int winding)
@ kConic_Verb
Definition SkPath.h:1461
@ kCubic_Verb
Definition SkPath.h:1462
@ kQuad_Verb
Definition SkPath.h:1460
@ kLine_Verb
Definition SkPath.h:1459
char dumpIsCoincidentStr() const
void dump() const
void dump() const
void dumpCurves() const
void dumpBounds() const
void dumpCoinCurves() const
void dumpBoth(SkTSect *) const
void dumpCoin() const
void dumpBounded(int id) const
void dumpCoin() const
void dump() const
const SkTSect * debugOpp() const
void dumpBounded(int id) const
const SkTSpan * next() const
void dumpAll() const
void dumpBounds() const
static float min(float r, float g, float b)
Definition hsl.cpp:48
double x
void dump() const
SkDQuad fPts
void dumpInner() const
void dumpID(int id) const
SkScalar fWeight
void dump() const
void dumpInner() const
void dumpID(int id) const
SkDPoint fPts[kPointCount]
SkDQuad fQuad
SkDConic fConic
SkDLine fLine
void dumpID(int) const
void dump() const
SkDCubic fCubic
void dumpID(int) const
void dump() const
SkDPoint fPts[2]
void dumpInner() const
static void Dump(const SkPoint &pt)
static void DumpHex(const SkPoint &pt)
void dump() const
void dumpID(int id) const
void dumpInner() const
void dump() const
SkDPoint ptAtT(double t) const
SkDPoint fPts[kPointCount]
double fTop
double fRight
double fBottom
double fLeft
void dump() const
SkPoint fPts[4]
float fX
x-axis value
float fY
y-axis value
SkTSpan * fBounded
SkTSpanBounded * fNext