14431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#include "SkOpContour.h"
24431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#include "SkIntersectionHelper.h"
34431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#include "SkOpSegment.h"
419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark#include "SkString.h"
54431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
64431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orginline void DebugDumpDouble(double x) {
74431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (x == floor(x)) {
84431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%.0f", x);
94431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%1.19g", x);
114431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orginline void DebugDumpFloat(float x) {
154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (x == floorf(x)) {
164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%.0f", x);
174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%1.9gf", x);
194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
2319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark#if DEBUG_SHOW_TEST_NAME
2419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
2519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkstatic void output_scalar(SkScalar num) {
2619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    if (num == (int) num) {
2719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        SkDebugf("%d", (int) num);
2819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    } else {
2919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        SkString str;
3019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        str.printf("%1.9g", num);
3119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        int width = (int) str.size();
3219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        const char* cStr = str.c_str();
3319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        while (cStr[width - 1] == '0') {
3419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            --width;
3519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        }
3619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        str.resize(width);
3719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        SkDebugf("%sf", str.c_str());
3819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    }
3919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark}
4019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
4119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkstatic void output_points(const SkPoint* pts, int count) {
4219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    for (int index = 0; index < count; ++index) {
4319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        output_scalar(pts[index].fX);
4419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        SkDebugf(", ");
4519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        output_scalar(pts[index].fY);
4619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        if (index + 1 < count) {
4719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            SkDebugf(", ");
4819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        }
4919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    }
5019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkDebugf(");\n");
5119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark}
5219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
5319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkstatic void showPathContours(SkPath::RawIter& iter, const char* pathName) {
5419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    uint8_t verb;
5519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkPoint pts[4];
5619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
5719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        switch (verb) {
5819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            case SkPath::kMove_Verb:
5919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                SkDebugf("    %s.moveTo(", pathName);
6019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                output_points(&pts[0], 1);
6119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                continue;
6219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            case SkPath::kLine_Verb:
6319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                SkDebugf("    %s.lineTo(", pathName);
6419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                output_points(&pts[1], 1);
6519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                break;
6619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            case SkPath::kQuad_Verb:
6719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                SkDebugf("    %s.quadTo(", pathName);
6819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                output_points(&pts[1], 2);
6919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                break;
7019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            case SkPath::kCubic_Verb:
7119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                SkDebugf("    %s.cubicTo(", pathName);
7219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                output_points(&pts[1], 3);
7319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                break;
7419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            case SkPath::kClose_Verb:
7519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                SkDebugf("    %s.close();\n", pathName);
7619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                break;
7719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            default:
7819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                SkDEBUGFAIL("bad verb");
7919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                return;
8019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        }
8119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    }
8219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark}
8319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
8419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkstatic const char* gFillTypeStr[] = {
8519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kWinding_FillType",
8619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kEvenOdd_FillType",
8719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kInverseWinding_FillType",
8819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kInverseEvenOdd_FillType"
8919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark};
9019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
9119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkvoid SkPathOpsDebug::ShowOnePath(const SkPath& path, const char* name, bool includeDeclaration) {
9219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkPath::RawIter iter(path);
9319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark#define SUPPORT_RECT_CONTOUR_DETECTION 0
9419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark#if SUPPORT_RECT_CONTOUR_DETECTION
9519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    int rectCount = path.isRectContours() ? path.rectContours(NULL, NULL) : 0;
9619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    if (rectCount > 0) {
9719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        SkTDArray<SkRect> rects;
9819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        SkTDArray<SkPath::Direction> directions;
9919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        rects.setCount(rectCount);
10019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        directions.setCount(rectCount);
10119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        path.rectContours(rects.begin(), directions.begin());
10219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        for (int contour = 0; contour < rectCount; ++contour) {
10319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            const SkRect& rect = rects[contour];
10419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark            SkDebugf("path.addRect(%1.9g, %1.9g, %1.9g, %1.9g, %s);\n", rect.fLeft, rect.fTop,
10519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                    rect.fRight, rect.fBottom, directions[contour] == SkPath::kCCW_Direction
10619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark                    ? "SkPath::kCCW_Direction" : "SkPath::kCW_Direction");
10719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        }
10819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        return;
10919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    }
11019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark#endif
11119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkPath::FillType fillType = path.getFillType();
11219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInverseEvenOdd_FillType);
11319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    if (includeDeclaration) {
11419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        SkDebugf("    SkPath %s;\n", name);
11519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    }
11619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkDebugf("    %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]);
11719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    iter.setPath(path);
11819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    showPathContours(iter, name);
11919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark}
12019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
12119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkstatic void show_function_header(const char* functionName) {
12219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkDebugf("\nstatic void %s(skiatest::Reporter* reporter, const char* filename) {\n", functionName);
12319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    if (strcmp("skphealth_com76", functionName) == 0) {
12419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        SkDebugf("found it\n");
12519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    }
12619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark}
12719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
12819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkstatic const char* gOpStrs[] = {
12919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kDifference_PathOp",
13019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kIntersect_PathOp",
13119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kUnion_PathOp",
13219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kXor_PathOp",
13319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    "kReverseDifference_PathOp",
13419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark};
13519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
13619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkstatic void show_op(SkPathOp op, const char* pathOne, const char* pathTwo) {
13719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkDebugf("    testPathOp(reporter, %s, %s, %s, filename);\n", pathOne, pathTwo, gOpStrs[op]);
13819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkDebugf("}\n");
13919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark}
14019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
14119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkSK_DECLARE_STATIC_MUTEX(gTestMutex);
14219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
14319eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclarkvoid SkPathOpsDebug::ShowPath(const SkPath& a, const SkPath& b, SkPathOp shapeOp,
14419eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark        const char* testName) {
14519eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    SkAutoMutexAcquire ac(gTestMutex);
14619eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    show_function_header(testName);
14719eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    ShowOnePath(a, "path", true);
14819eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    ShowOnePath(b, "pathB", true);
14919eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark    show_op(shapeOp, "path", "pathB");
15019eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark}
15119eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark#endif
15219eb3b2f0aa6dce5c0335230a8930e90733e5d5dcaryclark
1534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org// if not defined by PathOpsDebug.cpp ...
1544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#if !defined SK_DEBUG && FORCE_RELEASE
1554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgbool SkPathOpsDebug::ValidWind(int wind) {
1564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    return wind > SK_MinS32 + 0xFFFF && wind < SK_MaxS32 - 0xFFFF;
1574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
1584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
1594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::WindingPrintf(int wind) {
1604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (wind == SK_MinS32) {
1614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("?");
1624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
1634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%d", wind);
1644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
1654431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
1664431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org#endif
1674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
1684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpAngle::dump() const {
169dac1d17027dcaa5596885a9f333979418b35001ccaryclark    dumpOne(true);
1704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
1714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
1724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
173dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpAngle::dumpOne(bool functionHeader) const {
174dac1d17027dcaa5596885a9f333979418b35001ccaryclark//    fSegment->debugValidate();
175dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpSpan& mSpan = fSegment->span(SkMin32(fStart, fEnd));
176dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (functionHeader) {
177dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("%s ", __FUNCTION__);
178dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
179dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("[%d", fSegment->debugID());
180dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("/%d", debugID());
181dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("] next=");
182dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fNext) {
183dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("%d", fNext->fSegment->debugID());
184dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("/%d", fNext->debugID());
185dac1d17027dcaa5596885a9f333979418b35001ccaryclark    } else {
186dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("?");
187dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
188dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf(" sect=%d/%d ", fSectorStart, fSectorEnd);
189dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf(" s=%1.9g [%d] e=%1.9g [%d]", fSegment->span(fStart).fT, fStart,
190dac1d17027dcaa5596885a9f333979418b35001ccaryclark            fSegment->span(fEnd).fT, fEnd);
191dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf(" sgn=%d windVal=%d", sign(), mSpan.fWindValue);
192dac1d17027dcaa5596885a9f333979418b35001ccaryclark
193dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf(" windSum=");
194dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::WindingPrintf(mSpan.fWindSum);
195dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (mSpan.fOppValue != 0 || mSpan.fOppSum != SK_MinS32) {
196dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" oppVal=%d", mSpan.fOppValue);
197dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" oppSum=");
198dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkPathOpsDebug::WindingPrintf(mSpan.fOppSum);
199dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
200dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (mSpan.fDone) {
201dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" done");
202dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
203dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (unorderable()) {
204dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" unorderable");
205dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
206dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (small()) {
207dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" small");
208dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
209dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (mSpan.fTiny) {
210dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" tiny");
211dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
212dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fSegment->operand()) {
213dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" operand");
214dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
215dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fStop) {
216dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" stop");
217dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
218dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
219dac1d17027dcaa5596885a9f333979418b35001ccaryclark
220dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpAngle::dumpTo(const SkOpSegment* segment, const SkOpAngle* to) const {
2214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* first = this;
2224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* next = this;
2234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const char* indent = "";
2244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
2254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("%s", indent);
226dac1d17027dcaa5596885a9f333979418b35001ccaryclark        next->dumpOne(false);
2274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (segment == next->fSegment) {
228dac1d17027dcaa5596885a9f333979418b35001ccaryclark            if (this == fNext) {
2294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org                SkDebugf(" << from");
2304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            }
231dac1d17027dcaa5596885a9f333979418b35001ccaryclark            if (to == fNext) {
2324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org                SkDebugf(" << to");
2334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            }
2344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
2354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("\n");
2364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        indent = "           ";
2374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        next = next->fNext;
2384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (next && next != first);
2394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpAngle::dumpLoop() const {
2424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* first = this;
2434431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* next = this;
2444431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
245e4097e3a0b10bb0047a45b6949ca01826f0807a7caryclark        next->dumpOne(false);
246e4097e3a0b10bb0047a45b6949ca01826f0807a7caryclark        SkDebugf("\n");
2474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        next = next->fNext;
2484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (next && next != first);
2494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpAngle::dumpPartials() const {
2524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* first = this;
2534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpAngle* next = this;
2544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
2554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        next->fCurvePart.dumpNumber();
2564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        next = next->fNext;
2574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (next && next != first);
2584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
260dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpAngleSet::dump() const {
261dac1d17027dcaa5596885a9f333979418b35001ccaryclark    // FIXME: unimplemented
262dac1d17027dcaa5596885a9f333979418b35001ccaryclark/* This requires access to the internal SkChunkAlloc data
263dac1d17027dcaa5596885a9f333979418b35001ccaryclark   Defer implementing this until it is needed for debugging
264dac1d17027dcaa5596885a9f333979418b35001ccaryclark*/
265dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkASSERT(0);
266dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
267dac1d17027dcaa5596885a9f333979418b35001ccaryclark
2684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpContour::dump() const {
2694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int segmentCount = fSegments.count();
2704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID());
2714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int test = 0; test < segmentCount; ++test) {
2724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ((SkOpSegment*) 0x%p) [%d]\n", test, &fSegments[test],
2734431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org                fSegments[test].debugID());
2744431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
2754431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2764431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
2774431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpContour::dumpAngles() const {
2784431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int segmentCount = fSegments.count();
2794431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID());
2804431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int test = 0; test < segmentCount; ++test) {
2814431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", test);
2824431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fSegments[test].dumpAngles();
2834431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
2844431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
2854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
286dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpContour::dumpCoincidence(const SkCoincidence& coin) const {
287dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int thisIndex = coin.fSegments[0];
288dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpSegment& s1 = fSegments[thisIndex];
289dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int otherIndex = coin.fSegments[1];
290dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpSegment& s2 = coin.fOther->fSegments[otherIndex];
291dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("((SkOpSegment*) 0x%p) [%d]  ((SkOpSegment*) 0x%p) [%d]\n", &s1, s1.debugID(),
292dac1d17027dcaa5596885a9f333979418b35001ccaryclark            &s2, s2.debugID());
293dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < 2; ++index) {
294dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("    {%1.9gf, %1.9gf}", coin.fPts[0][index].fX, coin.fPts[0][index].fY);
295dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (coin.fNearly[index]) {
296dac1d17027dcaa5596885a9f333979418b35001ccaryclark            SkDebugf("    {%1.9gf, %1.9gf}", coin.fPts[1][index].fX, coin.fPts[1][index].fY);
297dac1d17027dcaa5596885a9f333979418b35001ccaryclark        }
298dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("  seg1t=%1.9g seg2t=%1.9g\n", coin.fTs[0][index], coin.fTs[1][index]);
299dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
300dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
301dac1d17027dcaa5596885a9f333979418b35001ccaryclark
302dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpContour::dumpCoincidences() const {
303dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = fCoincidences.count();
304dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (count > 0) {
305dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf("fCoincidences count=%d\n", count);
306dac1d17027dcaa5596885a9f333979418b35001ccaryclark        for (int test = 0; test < count; ++test) {
307dac1d17027dcaa5596885a9f333979418b35001ccaryclark            dumpCoincidence(fCoincidences[test]);
308dac1d17027dcaa5596885a9f333979418b35001ccaryclark        }
309dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
310dac1d17027dcaa5596885a9f333979418b35001ccaryclark    count = fPartialCoincidences.count();
311dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (count == 0) {
312dac1d17027dcaa5596885a9f333979418b35001ccaryclark        return;
313dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
314dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkDebugf("fPartialCoincidences count=%d\n", count);
315dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int test = 0; test < count; ++test) {
316dac1d17027dcaa5596885a9f333979418b35001ccaryclark        dumpCoincidence(fPartialCoincidences[test]);
317dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
318dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
319dac1d17027dcaa5596885a9f333979418b35001ccaryclark
320dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpContour::dumpPt(int index) const {
321dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int segmentCount = fSegments.count();
322dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int test = 0; test < segmentCount; ++test) {
323dac1d17027dcaa5596885a9f333979418b35001ccaryclark        const SkOpSegment& segment = fSegments[test];
324dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (segment.debugID() == index) {
325dac1d17027dcaa5596885a9f333979418b35001ccaryclark            fSegments[test].dumpPts();
326dac1d17027dcaa5596885a9f333979418b35001ccaryclark        }
327dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
328dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
329dac1d17027dcaa5596885a9f333979418b35001ccaryclark
3304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpContour::dumpPts() const {
3314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int segmentCount = fSegments.count();
3324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID());
3334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int test = 0; test < segmentCount; ++test) {
3344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", test);
3354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fSegments[test].dumpPts();
3364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
339dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkOpContour::dumpSpan(int index) const {
340dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int segmentCount = fSegments.count();
341dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int test = 0; test < segmentCount; ++test) {
342dac1d17027dcaa5596885a9f333979418b35001ccaryclark        const SkOpSegment& segment = fSegments[test];
343dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (segment.debugID() == index) {
344dac1d17027dcaa5596885a9f333979418b35001ccaryclark            fSegments[test].dumpSpans();
345dac1d17027dcaa5596885a9f333979418b35001ccaryclark        }
346dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
347dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
348dac1d17027dcaa5596885a9f333979418b35001ccaryclark
3494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpContour::dumpSpans() const {
3504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int segmentCount = fSegments.count();
3514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID());
3524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int test = 0; test < segmentCount; ++test) {
3534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", test);
3544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fSegments[test].dumpSpans();
3554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDCubic::dump() const {
3594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{{");
3604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
3614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
3624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fPts[index].dump();
3634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(", ");
3644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index < 3);
3654431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    fPts[index].dump();
3664431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
3674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDCubic::dumpNumber() const {
3704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{{");
3714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
3724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    bool dumpedOne = false;
3734431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
3744431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (!(fPts[index].fX == fPts[index].fX && fPts[index].fY == fPts[index].fY)) {
3754431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            continue;
3764431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
3774431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (dumpedOne) {
3784431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            SkDebugf(", ");
3794431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
3804431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fPts[index].dump();
3814431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        dumpedOne = true;
3824431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index < 3);
3834431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (fPts[index].fX == fPts[index].fX && fPts[index].fY == fPts[index].fY) {
3844431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (dumpedOne) {
3854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            SkDebugf(", ");
3864431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
3874431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fPts[index].dump();
3884431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
3894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
3904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
3924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDLine::dump() const {
3934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{{");
3944431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    fPts[0].dump();
3954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(", ");
3964431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    fPts[1].dump();
3974431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
3984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
3994431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDPoint::dump() const {
4014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{");
4024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpDouble(fX);
4034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(", ");
4044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpDouble(fY);
4054431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}");
4064431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4074431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4084431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDPoint::Dump(const SkPoint& pt) {
4094431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{");
4104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpFloat(pt.fX);
4114431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(", ");
4124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpFloat(pt.fY);
4134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}");
4144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDQuad::dumpComma(const char* comma) const {
4184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("{{");
4194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
4204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
4214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        fPts[index].dump();
4224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(", ");
4234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index < 2);
4244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    fPts[index].dump();
4254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}%s\n", comma ? comma : "");
4264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkDQuad::dump() const {
4294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpComma("");
4304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkIntersectionHelper::dump() const {
4334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDPoint::Dump(pts()[0]);
4344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDPoint::Dump(pts()[1]);
4354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (verb() >= SkPath::kQuad_Verb) {
4364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDPoint::Dump(pts()[2]);
4374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (verb() >= SkPath::kCubic_Verb) {
4394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDPoint::Dump(pts()[3]);
4404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4438cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.orgconst SkTDArray<SkOpSpan>& SkOpSegment::debugSpans() const {
4448cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org    return fTs;
4458cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org}
4468cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org
4474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpAngles() const {
4484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID());
449dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpAngle* fromAngle = NULL;
450dac1d17027dcaa5596885a9f333979418b35001ccaryclark    const SkOpAngle* toAngle = NULL;
4514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count(); ++index) {
452dac1d17027dcaa5596885a9f333979418b35001ccaryclark        const SkOpAngle* fAngle = fTs[index].fFromAngle;
453dac1d17027dcaa5596885a9f333979418b35001ccaryclark        const SkOpAngle* tAngle = fTs[index].fToAngle;
454dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (fromAngle == fAngle && toAngle == tAngle) {
4554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            continue;
4564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
457dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (fAngle) {
458dac1d17027dcaa5596885a9f333979418b35001ccaryclark            SkDebugf("  [%d] from=%d ", index, fAngle->debugID());
459dac1d17027dcaa5596885a9f333979418b35001ccaryclark            fAngle->dumpTo(this, tAngle);
4604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
461dac1d17027dcaa5596885a9f333979418b35001ccaryclark        if (tAngle) {
462dac1d17027dcaa5596885a9f333979418b35001ccaryclark            SkDebugf("  [%d] to=%d   ", index, tAngle->debugID());
463dac1d17027dcaa5596885a9f333979418b35001ccaryclark            tAngle->dumpTo(this, fAngle);
4644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
465dac1d17027dcaa5596885a9f333979418b35001ccaryclark        fromAngle = fAngle;
466dac1d17027dcaa5596885a9f333979418b35001ccaryclark        toAngle = tAngle;
4674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpContour(int firstID, int lastID) const {
4714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (debugID() < 0) {
4724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        return;
4734431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4744431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpSegment* test = this - (debugID() - 1);
4754431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    test += (firstID - 1);
4764431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpSegment* last = test + (lastID - firstID);
4774431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    while (test <= last) {
4784431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        test->dumpSpans();
4794431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        ++test;
4804431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
4814431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4824431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4834431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpPts() const {
4844431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int last = SkPathOpsVerbToPoints(fVerb);
4854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpSegment*) 0x%p) [%d] {{", this, debugID());
4864431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
4874431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
4884431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDPoint::Dump(fPts[index]);
4894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(", ");
4904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index < last);
4914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDPoint::Dump(fPts[index]);
4924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
4934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
4944431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
4954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpDPts() const {
4964431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = SkPathOpsVerbToPoints(fVerb);
4974431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpSegment*) 0x%p) [%d] {{", this, debugID());
4984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int index = 0;
4994431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    do {
5004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDPoint dPt = {fPts[index].fX, fPts[index].fY};
5014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        dPt.dump();
5024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (index != count) {
5034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            SkDebugf(", ");
5044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
5054431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } while (++index <= count);
5064431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("}}\n");
5074431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5084431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5094431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSegment::dumpSpans() const {
5104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = this->count();
5114431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID());
5124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSpan& span = this->span(index);
5144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", index);
5154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        span.dumpOne();
5164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
519dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpCoincidence(const SkTArray<SkOpContour, true>& contours) {
520dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
5214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
522dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index].dumpCoincidences();
5234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
526dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpCoincidence(const SkTArray<SkOpContour* , true>& contours) {
527dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
5284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
529dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index]->dumpCoincidences();
5304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContours(const SkTArray<SkOpContour, true>& contours) {
5344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
5354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index].dump();
5374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContours(const SkTArray<SkOpContour* , true>& contours) {
5414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
5424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5434431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index]->dump();
5444431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5454431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5464431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourAngles(const SkTArray<SkOpContour, true>& contours) {
5484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
5494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index].dumpAngles();
5514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourAngles(const SkTArray<SkOpContour* , true>& contours) {
5554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
5564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index]->dumpAngles();
5584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourPts(const SkTArray<SkOpContour, true>& contours) {
5624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
5634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index].dumpPts();
5654431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5664431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourPts(const SkTArray<SkOpContour* , true>& contours) {
5694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
5704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index]->dumpPts();
5724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5734431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5744431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
575dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpContourPt(const SkTArray<SkOpContour, true>& contours, int segmentID) {
576dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
577dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < count; ++index) {
578dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index].dumpPt(segmentID);
579dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
580dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
581dac1d17027dcaa5596885a9f333979418b35001ccaryclark
582dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpContourPt(const SkTArray<SkOpContour* , true>& contours, int segmentID) {
583dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
584dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < count; ++index) {
585dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index]->dumpPt(segmentID);
586dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
587dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
588dac1d17027dcaa5596885a9f333979418b35001ccaryclark
5894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourSpans(const SkTArray<SkOpContour, true>& contours) {
5904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
5914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index].dumpSpans();
5934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
5944431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
5954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
5964431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpContourSpans(const SkTArray<SkOpContour* , true>& contours) {
5974431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = contours.count();
5984431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
5994431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        contours[index]->dumpSpans();
6004431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
6014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
603dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpContourSpan(const SkTArray<SkOpContour, true>& contours, int segmentID) {
604dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
605dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < count; ++index) {
606dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index].dumpSpan(segmentID);
607dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
608dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
609dac1d17027dcaa5596885a9f333979418b35001ccaryclark
610dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid SkPathOpsDebug::DumpContourSpan(const SkTArray<SkOpContour* , true>& contours, int segmentID) {
611dac1d17027dcaa5596885a9f333979418b35001ccaryclark    int count = contours.count();
612dac1d17027dcaa5596885a9f333979418b35001ccaryclark    for (int index = 0; index < count; ++index) {
613dac1d17027dcaa5596885a9f333979418b35001ccaryclark        contours[index]->dumpSpan(segmentID);
614dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
615dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
616dac1d17027dcaa5596885a9f333979418b35001ccaryclark
6174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkPathOpsDebug::DumpSpans(const SkTDArray<SkOpSpan *>& spans) {
6184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int count = spans.count();
6194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < count; ++index) {
6204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSpan* span = spans[index];
6214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSpan& oSpan = span->fOther->span(span->fOtherIndex);
6224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSegment* segment = oSpan.fOther;
6234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("((SkOpSegment*) 0x%p) [%d] ", segment, segment->debugID());
6244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("spanIndex:%d ", oSpan.fOtherIndex);
6254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        span->dumpOne();
6264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
6274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org// this does not require that other T index is initialized or correct
6304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgconst SkOpSegment* SkOpSpan::debugToSegment(ptrdiff_t* spanIndex) const {
6314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (!fOther) {
6324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        return NULL;
6334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
6344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    int oppCount = fOther->count();
6354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    for (int index = 0; index < oppCount; ++index) {
6364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSpan& otherSpan = fOther->span(index);
6374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        double otherTestT = otherSpan.fT;
6384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (otherTestT < fOtherT) {
6394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            continue;
6404431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
6414431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkASSERT(otherTestT == fOtherT);
6424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        const SkOpSegment* candidate = otherSpan.fOther;
6438cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org        const SkOpSpan* first = candidate->debugSpans().begin();
6448cb1daaa1e4343eb60a7c4f21c12e33de30dad64commit-bot@chromium.org        const SkOpSpan* last = candidate->debugSpans().end() - 1;
6454431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        if (first <= this && this <= last) {
6464431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            if (spanIndex) {
6474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org                *spanIndex = this - first;
6484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            }
6494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org            return candidate;
6504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        }
6514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
6524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkASSERT(0);
6534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    return NULL;
6544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
6554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
6564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSpan::dumpOne() const {
6574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("t=");
6584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    DebugDumpDouble(fT);
6594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(" pt=");
6604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDPoint::Dump(fPt);
6614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (fOther) {
6624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" other.fID=%d", fOther->debugID());
6634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" [%d] otherT=", fOtherIndex);
6644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        DebugDumpDouble(fOtherT);
6654431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
6664431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" other.fID=? [?] otherT=?");
6674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
668dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fWindSum != SK_MinS32) {
669dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" windSum=%d", fWindSum);
670dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
671dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fOppSum != SK_MinS32 && (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0)) {
672dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" oppSum=%d", fOppSum);
6734431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
6744431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf(" windValue=%d", fWindValue);
6754431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0) {
6764431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" oppValue=%d", fOppValue);
6774431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
678dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fFromAngle && fFromAngle->debugID()) {
679dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" from=%d", fFromAngle->debugID());
680dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
681dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fToAngle && fToAngle->debugID()) {
682dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" to=%d", fToAngle->debugID());
683dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
684dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fChased) {
685dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" chased");
686dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
687dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fCoincident) {
688dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" coincident");
689dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
6904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (fDone) {
6914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" done");
6924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
693dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fLoop) {
694dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" loop");
695dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
696dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fMultiple) {
697dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" multiple");
698dac1d17027dcaa5596885a9f333979418b35001ccaryclark    }
699dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fNear) {
700dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" near");
7014431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
7024431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (fSmall) {
7034431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf(" small");
7044431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
705dac1d17027dcaa5596885a9f333979418b35001ccaryclark    if (fTiny) {
706dac1d17027dcaa5596885a9f333979418b35001ccaryclark        SkDebugf(" tiny");
7074431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
7084431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
7094431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7104431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7114431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid SkOpSpan::dump() const {
7124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    ptrdiff_t spanIndex;
7134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    const SkOpSegment* segment = debugToSegment(&spanIndex);
7144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (segment) {
7154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", segment, segment->debugID());
7164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [%d] ", spanIndex);
7174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    } else {
7184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("((SkOpSegment*) ?) [?]\n");
7194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  [?] ");
7204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
7214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpOne();
7224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid Dump(const SkTArray<class SkOpContour, true>& contours) {
7254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContours(contours);
7264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7284431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid Dump(const SkTArray<class SkOpContour* , true>& contours) {
7294431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContours(contours);
7304431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7314431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7324431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid Dump(const SkTArray<class SkOpContour, true>* contours) {
7334431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContours(*contours);
7344431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7354431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7364431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid Dump(const SkTArray<class SkOpContour* , true>* contours) {
7374431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContours(*contours);
7384431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7394431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
740dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid Dump(const SkTDArray<SkOpSpan *>& chase) {
741dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpSpans(chase);
7424431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7434431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
744dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid Dump(const SkTDArray<SkOpSpan *>* chase) {
745dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpSpans(*chase);
7464431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpAngles(const SkTArray<class SkOpContour, true>& contours) {
7494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourAngles(contours);
7504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpAngles(const SkTArray<class SkOpContour* , true>& contours) {
7534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourAngles(contours);
7544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpAngles(const SkTArray<class SkOpContour, true>* contours) {
7574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourAngles(*contours);
7584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpAngles(const SkTArray<class SkOpContour* , true>* contours) {
7614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourAngles(*contours);
7624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
764dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpCoin(const SkTArray<class SkOpContour, true>& contours) {
765dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpCoincidence(contours);
766dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
767dac1d17027dcaa5596885a9f333979418b35001ccaryclark
768dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpCoin(const SkTArray<class SkOpContour* , true>& contours) {
769dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpCoincidence(contours);
770dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
771dac1d17027dcaa5596885a9f333979418b35001ccaryclark
772dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpCoin(const SkTArray<class SkOpContour, true>* contours) {
773dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpCoincidence(*contours);
774dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
775dac1d17027dcaa5596885a9f333979418b35001ccaryclark
776dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpCoin(const SkTArray<class SkOpContour* , true>* contours) {
777dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpCoincidence(*contours);
778dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
779dac1d17027dcaa5596885a9f333979418b35001ccaryclark
7804431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpSpans(const SkTArray<class SkOpContour, true>& contours) {
7814431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourSpans(contours);
7824431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7834431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7844431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpSpans(const SkTArray<class SkOpContour* , true>& contours) {
7854431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourSpans(contours);
7864431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7874431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7884431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpSpans(const SkTArray<class SkOpContour, true>* contours) {
7894431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourSpans(*contours);
7904431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7914431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
7924431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpSpans(const SkTArray<class SkOpContour* , true>* contours) {
7934431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourSpans(*contours);
7944431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
7954431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
796dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpSpan(const SkTArray<class SkOpContour, true>& contours, int segmentID) {
797dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourSpan(contours, segmentID);
798dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
799dac1d17027dcaa5596885a9f333979418b35001ccaryclark
800dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpSpan(const SkTArray<class SkOpContour* , true>& contours, int segmentID) {
801dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourSpan(contours, segmentID);
802dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
803dac1d17027dcaa5596885a9f333979418b35001ccaryclark
804dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpSpan(const SkTArray<class SkOpContour, true>* contours, int segmentID) {
805dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourSpan(*contours, segmentID);
806dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
807dac1d17027dcaa5596885a9f333979418b35001ccaryclark
808dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpSpan(const SkTArray<class SkOpContour* , true>* contours, int segmentID) {
809dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourSpan(*contours, segmentID);
810dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
811dac1d17027dcaa5596885a9f333979418b35001ccaryclark
8124431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpPts(const SkTArray<class SkOpContour, true>& contours) {
8134431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourPts(contours);
8144431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
8154431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
8164431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpPts(const SkTArray<class SkOpContour* , true>& contours) {
8174431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourPts(contours);
8184431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
8194431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
8204431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpPts(const SkTArray<class SkOpContour, true>* contours) {
8214431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourPts(*contours);
8224431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
8234431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
8244431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpPts(const SkTArray<class SkOpContour* , true>* contours) {
8254431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkPathOpsDebug::DumpContourPts(*contours);
8264431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
8274431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
828dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpPt(const SkTArray<class SkOpContour, true>& contours, int segmentID) {
829dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourPt(contours, segmentID);
830dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
831dac1d17027dcaa5596885a9f333979418b35001ccaryclark
832dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpPt(const SkTArray<class SkOpContour* , true>& contours, int segmentID) {
833dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourPt(contours, segmentID);
834dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
835dac1d17027dcaa5596885a9f333979418b35001ccaryclark
836dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpPt(const SkTArray<class SkOpContour, true>* contours, int segmentID) {
837dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourPt(*contours, segmentID);
838dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
839dac1d17027dcaa5596885a9f333979418b35001ccaryclark
840dac1d17027dcaa5596885a9f333979418b35001ccaryclarkvoid DumpPt(const SkTArray<class SkOpContour* , true>* contours, int segmentID) {
841dac1d17027dcaa5596885a9f333979418b35001ccaryclark    SkPathOpsDebug::DumpContourPt(*contours, segmentID);
842dac1d17027dcaa5596885a9f333979418b35001ccaryclark}
843dac1d17027dcaa5596885a9f333979418b35001ccaryclark
8444431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgstatic void dumpTestCase(const SkDQuad& quad1, const SkDQuad& quad2, int testNo) {
8454431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("<div id=\"quad%d\">\n", testNo);
8464431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    quad1.dumpComma(",");
8474431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    quad2.dump();
8484431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("</div>\n\n");
8494431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
8504431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
8514431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgstatic void dumpTestTrailer() {
8524431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("</div>\n\n<script type=\"text/javascript\">\n\n");
8534431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("    var testDivs = [\n");
8544431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
8554431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
8564431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgstatic void dumpTestList(int testNo, double min) {
8574431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("        quad%d,", testNo);
8584431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    if (min > 0) {
8594431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org        SkDebugf("  // %1.9g", min);
8604431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    }
8614431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
8624431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
8634431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
8644431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo) {
8654431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
8664431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpTestCase(quad1, quad2, testNo);
8674431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpTestTrailer();
8684431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    dumpTestList(testNo, 0);
8694431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDebugf("\n");
8704431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
8714431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org
8724431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.orgvoid DumpT(const SkDQuad& quad, double t) {
8734431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    SkDLine line = {{quad.ptAtT(t), quad[0]}};
8744431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org    line.dump();
8754431e7757cfcb8cfa99535eed0e9f156dabf95c2commit-bot@chromium.org}
876