14431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#include "SkOpContour.h"
24431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#include "SkIntersectionHelper.h"
34431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#include "SkOpSegment.h"
44431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
54431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orginline void DebugDumpDouble(double x) {
64431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (x == floor(x)) {
74431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%.0f", x);
84431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
94431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%1.19g", x);
104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
114431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orginline void DebugDumpFloat(float x) {
144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (x == floorf(x)) {
154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%.0f", x);
164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%1.9gf", x);
184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org// if not defined by PathOpsDebug.cpp ...
224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#if !defined SK_DEBUG && FORCE_RELEASE
234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgbool SkPathOpsDebug::ValidWind(int wind) {
244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    return wind > SK_MinS32 + 0xFFFF && wind < SK_MaxS32 - 0xFFFF;
254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::WindingPrintf(int wind) {
284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (wind == SK_MinS32) {
294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("?");
304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%d", wind);
324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#endif
354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpAngle::dump() const {
37dac1d17027dcaa5596885a9f333979418b35001ccaryclark    dumpOne(true);
384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
41dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpAngle::dumpOne(bool functionHeader) const {
42dac1d17027dcaa5596885a9f333979418b35001ccaryclark//    fSegment->debugValidate();
43dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpSpan& mSpan = fSegment->span(SkMin32(fStart, fEnd));
44dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (functionHeader) {
45dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("%s ", __FUNCTION__);
46dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
47dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("[%d", fSegment->debugID());
48dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("/%d", debugID());
49dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("] next=");
50dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fNext) {
51dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("%d", fNext->fSegment->debugID());
52dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("/%d", fNext->debugID());
53dac1d17027dcaa5596885a9f333979418b35001ccaryclark    } else {
54dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("?");
55dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
56dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf(" sect=%d/%d ", fSectorStart, fSectorEnd);
57dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf(" s=%1.9g [%d] e=%1.9g [%d]", fSegment->span(fStart).fT, fStart,
58dac1d17027dcaa5596885a9f333979418b35001ccaryclark            fSegment->span(fEnd).fT, fEnd);
59dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf(" sgn=%d windVal=%d", sign(), mSpan.fWindValue);
60dac1d17027dcaa5596885a9f333979418b35001ccaryclark
61dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf(" windSum=");
62dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::WindingPrintf(mSpan.fWindSum);
63dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (mSpan.fOppValue != 0 || mSpan.fOppSum != SK_MinS32) {
64dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" oppVal=%d", mSpan.fOppValue);
65dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" oppSum=");
66dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkPathOpsDebug::WindingPrintf(mSpan.fOppSum);
67dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
68dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (mSpan.fDone) {
69dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" done");
70dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
71dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (unorderable()) {
72dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" unorderable");
73dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
74dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (small()) {
75dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" small");
76dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
77dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (mSpan.fTiny) {
78dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" tiny");
79dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
80dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fSegment->operand()) {
81dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" operand");
82dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
83dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fStop) {
84dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" stop");
85dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
86dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
87dac1d17027dcaa5596885a9f333979418b35001ccaryclark
88dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpAngle::dumpTo(const SkOpSegment* segment, const SkOpAngle* to) const {
894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* first = this;
904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* next = this;
914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const char* indent = "";
924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%s", indent);
94dac1d17027dcaa5596885a9f333979418b35001ccaryclark        next->dumpOne(false);
954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (segment == next->fSegment) {
96dac1d17027dcaa5596885a9f333979418b35001ccaryclark            if (this == fNext) {
974431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org                SkDebugf(" << from");
984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            }
99dac1d17027dcaa5596885a9f333979418b35001ccaryclark            if (to == fNext) {
1004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org                SkDebugf(" << to");
1014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            }
1024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
1034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("\n");
1044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        indent = "           ";
1054431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        next = next->fNext;
1064431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (next && next != first);
1074431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
1084431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
1094431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpAngle::dumpLoop() const {
1104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* first = this;
1114431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* next = this;
1124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
113e4097e3a0b10bb0047a45b6949ca01826f0807a7caryclark        next->dumpOne(false);
114e4097e3a0b10bb0047a45b6949ca01826f0807a7caryclark        SkDebugf("\n");
1154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        next = next->fNext;
1164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (next && next != first);
1174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
1184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
1194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpAngle::dumpPartials() const {
1204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* first = this;
1214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* next = this;
1224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
1234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        next->fCurvePart.dumpNumber();
1244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        next = next->fNext;
1254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (next && next != first);
1264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
1274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
128dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpAngleSet::dump() const {
129dac1d17027dcaa5596885a9f333979418b35001ccaryclark    // FIXME: unimplemented
130dac1d17027dcaa5596885a9f333979418b35001ccaryclark/* This requires access to the internal SkChunkAlloc data
131dac1d17027dcaa5596885a9f333979418b35001ccaryclark   Defer implementing this until it is needed for debugging
132dac1d17027dcaa5596885a9f333979418b35001ccaryclark*/
133dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkASSERT(0);
134dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
135dac1d17027dcaa5596885a9f333979418b35001ccaryclark
1364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpContour::dump() const {
1374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int segmentCount = fSegments.count();
1384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID());
1394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int test = 0; test < segmentCount; ++test) {
1404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ((SkOpSegment*) 0x%p) [%d]\n", test, &fSegments[test],
1414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org                fSegments[test].debugID());
1424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
1434431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
1444431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
1454431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpContour::dumpAngles() const {
1464431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int segmentCount = fSegments.count();
1474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID());
1484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int test = 0; test < segmentCount; ++test) {
1494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", test);
1504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fSegments[test].dumpAngles();
1514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
1524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
1534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
154dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpContour::dumpCoincidence(const SkCoincidence& coin) const {
155dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int thisIndex = coin.fSegments[0];
156dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpSegment& s1 = fSegments[thisIndex];
157dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int otherIndex = coin.fSegments[1];
158dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpSegment& s2 = coin.fOther->fSegments[otherIndex];
159dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("((SkOpSegment*) 0x%p) [%d]  ((SkOpSegment*) 0x%p) [%d]\n", &s1, s1.debugID(),
160dac1d17027dcaa5596885a9f333979418b35001ccaryclark            &s2, s2.debugID());
161dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < 2; ++index) {
162dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("    {%1.9gf, %1.9gf}", coin.fPts[0][index].fX, coin.fPts[0][index].fY);
163dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (coin.fNearly[index]) {
164dac1d17027dcaa5596885a9f333979418b35001ccaryclark            SkDebugf("    {%1.9gf, %1.9gf}", coin.fPts[1][index].fX, coin.fPts[1][index].fY);
165dac1d17027dcaa5596885a9f333979418b35001ccaryclark        }
166dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("  seg1t=%1.9g seg2t=%1.9g\n", coin.fTs[0][index], coin.fTs[1][index]);
167dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
168dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
169dac1d17027dcaa5596885a9f333979418b35001ccaryclark
170dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpContour::dumpCoincidences() const {
171dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = fCoincidences.count();
172dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (count > 0) {
173dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("fCoincidences count=%d\n", count);
174dac1d17027dcaa5596885a9f333979418b35001ccaryclark        for (int test = 0; test < count; ++test) {
175dac1d17027dcaa5596885a9f333979418b35001ccaryclark            dumpCoincidence(fCoincidences[test]);
176dac1d17027dcaa5596885a9f333979418b35001ccaryclark        }
177dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
178dac1d17027dcaa5596885a9f333979418b35001ccaryclark    count = fPartialCoincidences.count();
179dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (count == 0) {
180dac1d17027dcaa5596885a9f333979418b35001ccaryclark        return;
181dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
182dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("fPartialCoincidences count=%d\n", count);
183dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int test = 0; test < count; ++test) {
184dac1d17027dcaa5596885a9f333979418b35001ccaryclark        dumpCoincidence(fPartialCoincidences[test]);
185dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
186dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
187dac1d17027dcaa5596885a9f333979418b35001ccaryclark
188dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpContour::dumpPt(int index) const {
189dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int segmentCount = fSegments.count();
190dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int test = 0; test < segmentCount; ++test) {
191dac1d17027dcaa5596885a9f333979418b35001ccaryclark        const SkOpSegment& segment = fSegments[test];
192dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (segment.debugID() == index) {
193dac1d17027dcaa5596885a9f333979418b35001ccaryclark            fSegments[test].dumpPts();
194dac1d17027dcaa5596885a9f333979418b35001ccaryclark        }
195dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
196dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
197dac1d17027dcaa5596885a9f333979418b35001ccaryclark
1984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpContour::dumpPts() const {
1994431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int segmentCount = fSegments.count();
2004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID());
2014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int test = 0; test < segmentCount; ++test) {
2024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", test);
2034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fSegments[test].dumpPts();
2044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
2054431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2064431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
207dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpContour::dumpSpan(int index) const {
208dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int segmentCount = fSegments.count();
209dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int test = 0; test < segmentCount; ++test) {
210dac1d17027dcaa5596885a9f333979418b35001ccaryclark        const SkOpSegment& segment = fSegments[test];
211dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (segment.debugID() == index) {
212dac1d17027dcaa5596885a9f333979418b35001ccaryclark            fSegments[test].dumpSpans();
213dac1d17027dcaa5596885a9f333979418b35001ccaryclark        }
214dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
215dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
216dac1d17027dcaa5596885a9f333979418b35001ccaryclark
2174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpContour::dumpSpans() const {
2184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int segmentCount = fSegments.count();
2194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID());
2204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int test = 0; test < segmentCount; ++test) {
2214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", test);
2224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fSegments[test].dumpSpans();
2234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
2244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDCubic::dump() const {
2274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{{");
2284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
2294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
2304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fPts[index].dump();
2314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(", ");
2324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index < 3);
2334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    fPts[index].dump();
2344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
2354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDCubic::dumpNumber() const {
2384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{{");
2394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
2404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    bool dumpedOne = false;
2414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
2424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (!(fPts[index].fX == fPts[index].fX && fPts[index].fY == fPts[index].fY)) {
2434431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            continue;
2444431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
2454431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (dumpedOne) {
2464431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            SkDebugf(", ");
2474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
2484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fPts[index].dump();
2494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        dumpedOne = true;
2504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index < 3);
2514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (fPts[index].fX == fPts[index].fX && fPts[index].fY == fPts[index].fY) {
2524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (dumpedOne) {
2534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            SkDebugf(", ");
2544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
2554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fPts[index].dump();
2564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
2574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
2584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDLine::dump() const {
2614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{{");
2624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    fPts[0].dump();
2634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(", ");
2644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    fPts[1].dump();
2654431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
2664431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDPoint::dump() const {
2694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{");
2704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpDouble(fX);
2714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(", ");
2724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpDouble(fY);
2734431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}");
2744431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2754431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2764431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDPoint::Dump(const SkPoint& pt) {
2774431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{");
2784431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpFloat(pt.fX);
2794431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(", ");
2804431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpFloat(pt.fY);
2814431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}");
2824431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2834431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2844431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDQuad::dumpComma(const char* comma) const {
2864431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{{");
2874431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
2884431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
2894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fPts[index].dump();
2904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(", ");
2914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index < 2);
2924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    fPts[index].dump();
2934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}%s\n", comma ? comma : "");
2944431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2964431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDQuad::dump() const {
2974431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpComma("");
2984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2994431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkIntersectionHelper::dump() const {
3014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDPoint::Dump(pts()[0]);
3024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDPoint::Dump(pts()[1]);
3034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (verb() >= SkPath::kQuad_Verb) {
3044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDPoint::Dump(pts()[2]);
3054431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3064431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (verb() >= SkPath::kCubic_Verb) {
3074431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDPoint::Dump(pts()[3]);
3084431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3094431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3118cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.orgconst SkTDArray<SkOpSpan>& SkOpSegment::debugSpans() const {
3128cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org    return fTs;
3138cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org}
3148cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org
3154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpAngles() const {
3164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID());
317dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpAngle* fromAngle = NULL;
318dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpAngle* toAngle = NULL;
3194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count(); ++index) {
320dac1d17027dcaa5596885a9f333979418b35001ccaryclark        const SkOpAngle* fAngle = fTs[index].fFromAngle;
321dac1d17027dcaa5596885a9f333979418b35001ccaryclark        const SkOpAngle* tAngle = fTs[index].fToAngle;
322dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (fromAngle == fAngle && toAngle == tAngle) {
3234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            continue;
3244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
325dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (fAngle) {
326dac1d17027dcaa5596885a9f333979418b35001ccaryclark            SkDebugf("  [%d] from=%d ", index, fAngle->debugID());
327dac1d17027dcaa5596885a9f333979418b35001ccaryclark            fAngle->dumpTo(this, tAngle);
3284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
329dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (tAngle) {
330dac1d17027dcaa5596885a9f333979418b35001ccaryclark            SkDebugf("  [%d] to=%d   ", index, tAngle->debugID());
331dac1d17027dcaa5596885a9f333979418b35001ccaryclark            tAngle->dumpTo(this, fAngle);
3324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
333dac1d17027dcaa5596885a9f333979418b35001ccaryclark        fromAngle = fAngle;
334dac1d17027dcaa5596885a9f333979418b35001ccaryclark        toAngle = tAngle;
3354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpContour(int firstID, int lastID) const {
3394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (debugID() < 0) {
3404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        return;
3414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpSegment* test = this - (debugID() - 1);
3434431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    test += (firstID - 1);
3444431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpSegment* last = test + (lastID - firstID);
3454431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    while (test <= last) {
3464431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        test->dumpSpans();
3474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        ++test;
3484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpPts() const {
3524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int last = SkPathOpsVerbToPoints(fVerb);
3534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpSegment*) 0x%p) [%d] {{", this, debugID());
3544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
3554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
3564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDPoint::Dump(fPts[index]);
3574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(", ");
3584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index < last);
3594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDPoint::Dump(fPts[index]);
3604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
3614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpDPts() const {
3644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = SkPathOpsVerbToPoints(fVerb);
3654431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpSegment*) 0x%p) [%d] {{", this, debugID());
3664431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
3674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
3684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDPoint dPt = {fPts[index].fX, fPts[index].fY};
3694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        dPt.dump();
3704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (index != count) {
3714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            SkDebugf(", ");
3724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
3734431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index <= count);
3744431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
3754431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3764431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3774431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpSpans() const {
3784431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = this->count();
3794431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID());
3804431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
3814431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSpan& span = this->span(index);
3824431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", index);
3834431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        span.dumpOne();
3844431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3864431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
387dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpCoincidence(const SkTArray<SkOpContour, true>& contours) {
388dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
3894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
390dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index].dumpCoincidences();
3914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
394dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpCoincidence(const SkTArray<SkOpContour* , true>& contours) {
395dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
3964431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
397dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index]->dumpCoincidences();
3984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3994431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContours(const SkTArray<SkOpContour, true>& contours) {
4024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
4034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index].dump();
4054431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4064431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4074431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4084431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContours(const SkTArray<SkOpContour* , true>& contours) {
4094431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
4104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4114431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index]->dump();
4124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourAngles(const SkTArray<SkOpContour, true>& contours) {
4164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
4174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index].dumpAngles();
4194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourAngles(const SkTArray<SkOpContour* , true>& contours) {
4234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
4244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index]->dumpAngles();
4264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourPts(const SkTArray<SkOpContour, true>& contours) {
4304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
4314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index].dumpPts();
4334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourPts(const SkTArray<SkOpContour* , true>& contours) {
4374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
4384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index]->dumpPts();
4404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
443dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpContourPt(const SkTArray<SkOpContour, true>& contours, int segmentID) {
444dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
445dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < count; ++index) {
446dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index].dumpPt(segmentID);
447dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
448dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
449dac1d17027dcaa5596885a9f333979418b35001ccaryclark
450dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpContourPt(const SkTArray<SkOpContour* , true>& contours, int segmentID) {
451dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
452dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < count; ++index) {
453dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index]->dumpPt(segmentID);
454dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
455dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
456dac1d17027dcaa5596885a9f333979418b35001ccaryclark
4574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourSpans(const SkTArray<SkOpContour, true>& contours) {
4584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
4594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index].dumpSpans();
4614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourSpans(const SkTArray<SkOpContour* , true>& contours) {
4654431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
4664431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index]->dumpSpans();
4684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
471dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpContourSpan(const SkTArray<SkOpContour, true>& contours, int segmentID) {
472dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
473dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < count; ++index) {
474dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index].dumpSpan(segmentID);
475dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
476dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
477dac1d17027dcaa5596885a9f333979418b35001ccaryclark
478dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpContourSpan(const SkTArray<SkOpContour* , true>& contours, int segmentID) {
479dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
480dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < count; ++index) {
481dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index]->dumpSpan(segmentID);
482dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
483dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
484dac1d17027dcaa5596885a9f333979418b35001ccaryclark
4854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpSpans(const SkTDArray<SkOpSpan *>& spans) {
4864431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = spans.count();
4874431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
4884431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSpan* span = spans[index];
4894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSpan& oSpan = span->fOther->span(span->fOtherIndex);
4904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSegment* segment = oSpan.fOther;
4914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("((SkOpSegment*) 0x%p) [%d] ", segment, segment->debugID());
4924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("spanIndex:%d ", oSpan.fOtherIndex);
4934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        span->dumpOne();
4944431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4964431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4974431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org// this does not require that other T index is initialized or correct
4984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgconst SkOpSegment* SkOpSpan::debugToSegment(ptrdiff_t* spanIndex) const {
4994431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (!fOther) {
5004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        return NULL;
5014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int oppCount = fOther->count();
5034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < oppCount; ++index) {
5044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSpan& otherSpan = fOther->span(index);
5054431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        double otherTestT = otherSpan.fT;
5064431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (otherTestT < fOtherT) {
5074431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            continue;
5084431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
5094431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkASSERT(otherTestT == fOtherT);
5104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSegment* candidate = otherSpan.fOther;
5118cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org        const SkOpSpan* first = candidate->debugSpans().begin();
5128cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org        const SkOpSpan* last = candidate->debugSpans().end() - 1;
5134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (first <= this && this <= last) {
5144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            if (spanIndex) {
5154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org                *spanIndex = this - first;
5164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            }
5174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            return candidate;
5184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
5194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkASSERT(0);
5214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    return NULL;
5224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSpan::dumpOne() const {
5254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("t=");
5264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpDouble(fT);
5274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(" pt=");
5284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDPoint::Dump(fPt);
5294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (fOther) {
5304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" other.fID=%d", fOther->debugID());
5314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" [%d] otherT=", fOtherIndex);
5324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        DebugDumpDouble(fOtherT);
5334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
5344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" other.fID=? [?] otherT=?");
5354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
536dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fWindSum != SK_MinS32) {
537dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" windSum=%d", fWindSum);
538dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
539dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fOppSum != SK_MinS32 && (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0)) {
540dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" oppSum=%d", fOppSum);
5414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(" windValue=%d", fWindValue);
5434431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0) {
5444431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" oppValue=%d", fOppValue);
5454431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
546dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fFromAngle && fFromAngle->debugID()) {
547dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" from=%d", fFromAngle->debugID());
548dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
549dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fToAngle && fToAngle->debugID()) {
550dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" to=%d", fToAngle->debugID());
551dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
552dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fChased) {
553dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" chased");
554dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
555dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fCoincident) {
556dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" coincident");
557dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
5584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (fDone) {
5594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" done");
5604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
561dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fLoop) {
562dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" loop");
563dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
564dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fMultiple) {
565dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" multiple");
566dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
567dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fNear) {
568dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" near");
5694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (fSmall) {
5714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" small");
5724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
573dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fTiny) {
574dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" tiny");
5754431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5764431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
5774431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5784431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5794431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSpan::dump() const {
5804431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    ptrdiff_t spanIndex;
5814431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpSegment* segment = debugToSegment(&spanIndex);
5824431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (segment) {
5834431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", segment, segment->debugID());
5844431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", spanIndex);
5854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
5864431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("((SkOpSegment*) ?) [?]\n");
5874431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [?] ");
5884431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpOne();
5904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid Dump(const SkTArray<class SkOpContour, true>& contours) {
5934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContours(contours);
5944431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5964431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid Dump(const SkTArray<class SkOpContour* , true>& contours) {
5974431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContours(contours);
5984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5994431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid Dump(const SkTArray<class SkOpContour, true>* contours) {
6014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContours(*contours);
6024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid Dump(const SkTArray<class SkOpContour* , true>* contours) {
6054431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContours(*contours);
6064431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6074431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
608dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid Dump(const SkTDArray<SkOpSpan *>& chase) {
609dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpSpans(chase);
6104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6114431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
612dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid Dump(const SkTDArray<SkOpSpan *>* chase) {
613dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpSpans(*chase);
6144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpAngles(const SkTArray<class SkOpContour, true>& contours) {
6174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourAngles(contours);
6184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpAngles(const SkTArray<class SkOpContour* , true>& contours) {
6214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourAngles(contours);
6224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpAngles(const SkTArray<class SkOpContour, true>* contours) {
6254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourAngles(*contours);
6264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpAngles(const SkTArray<class SkOpContour* , true>* contours) {
6294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourAngles(*contours);
6304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
632dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpCoin(const SkTArray<class SkOpContour, true>& contours) {
633dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpCoincidence(contours);
634dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
635dac1d17027dcaa5596885a9f333979418b35001ccaryclark
636dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpCoin(const SkTArray<class SkOpContour* , true>& contours) {
637dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpCoincidence(contours);
638dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
639dac1d17027dcaa5596885a9f333979418b35001ccaryclark
640dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpCoin(const SkTArray<class SkOpContour, true>* contours) {
641dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpCoincidence(*contours);
642dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
643dac1d17027dcaa5596885a9f333979418b35001ccaryclark
644dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpCoin(const SkTArray<class SkOpContour* , true>* contours) {
645dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpCoincidence(*contours);
646dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
647dac1d17027dcaa5596885a9f333979418b35001ccaryclark
6484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpSpans(const SkTArray<class SkOpContour, true>& contours) {
6494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourSpans(contours);
6504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpSpans(const SkTArray<class SkOpContour* , true>& contours) {
6534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourSpans(contours);
6544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpSpans(const SkTArray<class SkOpContour, true>* contours) {
6574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourSpans(*contours);
6584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpSpans(const SkTArray<class SkOpContour* , true>* contours) {
6614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourSpans(*contours);
6624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
664dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpSpan(const SkTArray<class SkOpContour, true>& contours, int segmentID) {
665dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourSpan(contours, segmentID);
666dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
667dac1d17027dcaa5596885a9f333979418b35001ccaryclark
668dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpSpan(const SkTArray<class SkOpContour* , true>& contours, int segmentID) {
669dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourSpan(contours, segmentID);
670dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
671dac1d17027dcaa5596885a9f333979418b35001ccaryclark
672dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpSpan(const SkTArray<class SkOpContour, true>* contours, int segmentID) {
673dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourSpan(*contours, segmentID);
674dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
675dac1d17027dcaa5596885a9f333979418b35001ccaryclark
676dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpSpan(const SkTArray<class SkOpContour* , true>* contours, int segmentID) {
677dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourSpan(*contours, segmentID);
678dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
679dac1d17027dcaa5596885a9f333979418b35001ccaryclark
6804431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpPts(const SkTArray<class SkOpContour, true>& contours) {
6814431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourPts(contours);
6824431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6834431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6844431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpPts(const SkTArray<class SkOpContour* , true>& contours) {
6854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourPts(contours);
6864431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6874431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6884431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpPts(const SkTArray<class SkOpContour, true>* contours) {
6894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourPts(*contours);
6904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpPts(const SkTArray<class SkOpContour* , true>* contours) {
6934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourPts(*contours);
6944431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
696dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpPt(const SkTArray<class SkOpContour, true>& contours, int segmentID) {
697dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourPt(contours, segmentID);
698dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
699dac1d17027dcaa5596885a9f333979418b35001ccaryclark
700dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpPt(const SkTArray<class SkOpContour* , true>& contours, int segmentID) {
701dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourPt(contours, segmentID);
702dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
703dac1d17027dcaa5596885a9f333979418b35001ccaryclark
704dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpPt(const SkTArray<class SkOpContour, true>* contours, int segmentID) {
705dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourPt(*contours, segmentID);
706dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
707dac1d17027dcaa5596885a9f333979418b35001ccaryclark
708dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpPt(const SkTArray<class SkOpContour* , true>* contours, int segmentID) {
709dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourPt(*contours, segmentID);
710dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
711dac1d17027dcaa5596885a9f333979418b35001ccaryclark
7124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgstatic void dumpTestCase(const SkDQuad& quad1, const SkDQuad& quad2, int testNo) {
7134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("<div id=\"quad%d\">\n", testNo);
7144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    quad1.dumpComma(",");
7154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    quad2.dump();
7164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("</div>\n\n");
7174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgstatic void dumpTestTrailer() {
7204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("</div>\n\n<script type=\"text/javascript\">\n\n");
7214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("    var testDivs = [\n");
7224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgstatic void dumpTestList(int testNo, double min) {
7254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("        quad%d,", testNo);
7264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (min > 0) {
7274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  // %1.9g", min);
7284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
7294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
7304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo) {
7334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
7344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpTestCase(quad1, quad2, testNo);
7354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpTestTrailer();
7364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpTestList(testNo, 0);
7374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
7384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpT(const SkDQuad& quad, double t) {
7414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDLine line = {{quad.ptAtT(t), quad[0]}};
7424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    line.dump();
7434431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
744