SkOpContour.h revision 07393cab57ce74a4aae89a31fae9aaa9780fc19d
107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com/*
207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com * Copyright 2013 Google Inc.
307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com *
407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com * Use of this source code is governed by a BSD-style license that can be
507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com * found in the LICENSE file.
607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com */
707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#ifndef SkOpContour_DEFINED
807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#define SkOpContour_DEFINED
907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
1007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#include "SkOpSegment.h"
1107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#include "SkTArray.h"
1207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
1307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.comclass SkIntersections;
1407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.comclass SkOpContour;
1507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.comclass SkPathWriter;
1607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
1707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.comstruct SkCoincidence {
1807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkOpContour* fContours[2];
1907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int fSegments[2];
2007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    double fTs[2][2];
2107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkPoint fPts[2];
2207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com};
2307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
2407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.comclass SkOpContour {
2507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.compublic:
2607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkOpContour() {
2707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        reset();
2807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#if DEBUG_DUMP
2907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fID = ++gContourID;
3007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#endif
3107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
3207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
3307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool operator<(const SkOpContour& rh) const {
3407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fBounds.fTop == rh.fBounds.fTop
3507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com                ? fBounds.fLeft < rh.fBounds.fLeft
3607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com                : fBounds.fTop < rh.fBounds.fTop;
3707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
3807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
3907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void addCoincident(int index, SkOpContour* other, int otherIndex,
4007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com                       const SkIntersections& ts, bool swap);
4107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void addCoincidentPoints();
4207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
4307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void addCross(const SkOpContour* crosser) {
4407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#ifdef DEBUG_CROSS
4507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        for (int index = 0; index < fCrosses.count(); ++index) {
4607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            SkASSERT(fCrosses[index] != crosser);
4707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        }
4807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#endif
4907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        *fCrosses.append() = crosser;
5007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
5107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
5207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void addCubic(const SkPoint pts[4]) {
5307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fSegments.push_back().addCubic(pts, fOperand, fXor);
5407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fContainsCurves = fContainsCubics = true;
5507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
5607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
5707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int addLine(const SkPoint pts[2]) {
5807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fSegments.push_back().addLine(pts, fOperand, fXor);
5907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fSegments.count();
6007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
6107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
6207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void addOtherT(int segIndex, int tIndex, double otherT, int otherIndex) {
6307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fSegments[segIndex].addOtherT(tIndex, otherT, otherIndex);
6407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
6507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
6607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int addQuad(const SkPoint pts[3]) {
6707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fSegments.push_back().addQuad(pts, fOperand, fXor);
6807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fContainsCurves = true;
6907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fSegments.count();
7007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
7107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
7207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int addT(int segIndex, SkOpContour* other, int otherIndex, const SkPoint& pt, double newT) {
7307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        setContainsIntercepts();
7407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fSegments[segIndex].addT(&other->fSegments[otherIndex], pt, newT);
7507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
7607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
7707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int addSelfT(int segIndex, SkOpContour* other, int otherIndex, const SkPoint& pt, double newT) {
7807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        setContainsIntercepts();
7907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fSegments[segIndex].addSelfT(&other->fSegments[otherIndex], pt, newT);
8007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
8107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
8207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int addUnsortableT(int segIndex, SkOpContour* other, int otherIndex, bool start,
8307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com                       const SkPoint& pt, double newT) {
8407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fSegments[segIndex].addUnsortableT(&other->fSegments[otherIndex], start, pt, newT);
8507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
8607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
8707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    const SkPathOpsBounds& bounds() const {
8807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fBounds;
8907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
9007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
9107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void calcCoincidentWinding();
9207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
9307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void complete() {
9407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        setBounds();
9507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fContainsIntercepts = false;
9607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
9707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
9807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool containsCubics() const {
9907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fContainsCubics;
10007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
10107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
10207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool crosses(const SkOpContour* crosser) const {
10307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        for (int index = 0; index < fCrosses.count(); ++index) {
10407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            if (fCrosses[index] == crosser) {
10507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com                return true;
10607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            }
10707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        }
10807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return false;
10907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
11007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
11107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool done() const {
11207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fDone;
11307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
11407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
11507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    const SkPoint& end() const {
11607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        const SkOpSegment& segment = fSegments.back();
11707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return segment.pts()[segment.verb()];
11807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
11907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
12007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void findTooCloseToCall() {
12107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        int segmentCount = fSegments.count();
12207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
12307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            fSegments[sIndex].findTooCloseToCall();
12407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        }
12507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
12607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
12707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void fixOtherTIndex() {
12807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        int segmentCount = fSegments.count();
12907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
13007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            fSegments[sIndex].fixOtherTIndex();
13107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        }
13207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
13307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
13407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkOpSegment* nonVerticalSegment(int* start, int* end);
13507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
13607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool operand() const {
13707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fOperand;
13807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
13907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
14007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void reset() {
14107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fSegments.reset();
14207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fBounds.set(SK_ScalarMax, SK_ScalarMax, SK_ScalarMax, SK_ScalarMax);
14307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fContainsCurves = fContainsCubics = fContainsIntercepts = fDone = false;
14407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
14507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
14607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkTArray<SkOpSegment>& segments() {
14707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fSegments;
14807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
14907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
15007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void setContainsIntercepts() {
15107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fContainsIntercepts = true;
15207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
15307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
15407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void setOperand(bool isOp) {
15507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fOperand = isOp;
15607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
15707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
15807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void setOppXor(bool isOppXor) {
15907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fOppXor = isOppXor;
16007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        int segmentCount = fSegments.count();
16107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        for (int test = 0; test < segmentCount; ++test) {
16207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            fSegments[test].setOppXor(isOppXor);
16307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        }
16407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
16507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
16607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void setXor(bool isXor) {
16707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        fXor = isXor;
16807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
16907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
17007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void sortSegments();
17107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
17207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    const SkPoint& start() const {
17307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fSegments.front().pts()[0];
17407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
17507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
17607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void toPath(SkPathWriter* path) const;
17707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
17807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void toPartialBackward(SkPathWriter* path) const {
17907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        int segmentCount = fSegments.count();
18007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        for (int test = segmentCount - 1; test >= 0; --test) {
18107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            fSegments[test].addCurveTo(1, 0, path, true);
18207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        }
18307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
18407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
18507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void toPartialForward(SkPathWriter* path) const {
18607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        int segmentCount = fSegments.count();
18707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        for (int test = 0; test < segmentCount; ++test) {
18807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            fSegments[test].addCurveTo(0, 1, path, true);
18907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        }
19007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
19107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
19207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void topSortableSegment(const SkPoint& topLeft, SkPoint* bestXY, SkOpSegment** topStart);
19307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkOpSegment* undoneSegment(int* start, int* end);
19407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
19507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int updateSegment(int index, const SkPoint* pts) {
19607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        SkOpSegment& segment = fSegments[index];
19707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        segment.updatePts(pts);
19807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return segment.verb() + 1;
19907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
20007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
20107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#if DEBUG_TEST
20207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkTArray<SkOpSegment>& debugSegments() {
20307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        return fSegments;
20407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
20507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#endif
20607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
20707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#if DEBUG_ACTIVE_SPANS
20807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void debugShowActiveSpans() {
20907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        for (int index = 0; index < fSegments.count(); ++index) {
21007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com            fSegments[index].debugShowActiveSpans();
21107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com        }
21207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    }
21307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#endif
21407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
21507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#if DEBUG_SHOW_WINDING
21607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int debugShowWindingValues(int totalSegments, int ofInterest);
21707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    static void debugShowWindingValues(const SkTDArray<SkOpContour*>& contourList);
21807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#endif
21907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
22007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.comprivate:
22107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    void setBounds();
22207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
22307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkTArray<SkOpSegment> fSegments;
22407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkTDArray<SkOpSegment*> fSortedSegments;
22507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int fFirstSorted;
22607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkTDArray<SkCoincidence> fCoincidences;
22707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkTDArray<const SkOpContour*> fCrosses;
22807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    SkPathOpsBounds fBounds;
22907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool fContainsIntercepts;  // FIXME: is this used by anybody?
23007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool fContainsCubics;
23107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool fContainsCurves;
23207393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool fDone;
23307393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool fOperand;  // true for the second argument to a binary operator
23407393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool fXor;
23507393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    bool fOppXor;
23607393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#if DEBUG_DUMP
23707393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com    int fID;
23807393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#endif
23907393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com};
24007393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com
24107393cab57ce74a4aae89a31fae9aaa9780fc19dcaryclark@google.com#endif
242