diff options
Diffstat (limited to 'src/pathops/SkOpCoincidence.h')
-rw-r--r-- | src/pathops/SkOpCoincidence.h | 81 |
1 files changed, 45 insertions, 36 deletions
diff --git a/src/pathops/SkOpCoincidence.h b/src/pathops/SkOpCoincidence.h index 5815196b2c..e4d7aa2b35 100644 --- a/src/pathops/SkOpCoincidence.h +++ b/src/pathops/SkOpCoincidence.h @@ -31,12 +31,20 @@ public: void correctOneEnd(const SkOpPtT* (SkCoincidentSpans::* getEnd)() const, void (SkCoincidentSpans::* setEnd)(const SkOpPtT* ptT) ); -#if DEBUG_COINCIDENCE_VERBOSE - bool debugExpand(const char* id, SkPathOpsDebug::GlitchLog* log) const; +#if DEBUG_COIN + void debugCorrectEnds(SkPathOpsDebug::GlitchLog* log) const; + void debugCorrectOneEnd(SkPathOpsDebug::GlitchLog* log, + const SkOpPtT* (SkCoincidentSpans::* getEnd)() const, + void (SkCoincidentSpans::* setEnd)(const SkOpPtT* ptT) const) const; + bool debugExpand(SkPathOpsDebug::GlitchLog* log) const; #endif - int debugID() const { - return SkDEBUGRELEASE(fID, -1); + const char* debugID() const { +#if DEBUG_COIN + return fGlobalState->debugCoinDictEntry().fFunctionName; +#else + return nullptr; +#endif } void debugShow() const; @@ -69,8 +77,7 @@ public: int spanCount() const; void set(SkCoincidentSpans* next, const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, - const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd - SkDEBUGPARAMS(int id)); + const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd); void setCoinPtTEnd(const SkOpPtT* ptT) { SkOPASSERT(ptT == ptT->span()->ptT()); @@ -127,7 +134,6 @@ private: const SkOpPtT* fOppPtTStart; const SkOpPtT* fOppPtTEnd; SkDEBUGCODE(SkOpGlobalState* fGlobalState); - SkDEBUGCODE(int fID); }; class SkOpCoincidence { @@ -146,19 +152,20 @@ public: void add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart, SkOpPtT* oppPtTEnd); - bool addEndMovedSpans(); - bool addExpanded(); - bool addMissing(bool* added); + bool addEndMovedSpans(DEBUG_COIN_DECLARE_ONLY_PARAMS()); + bool addExpanded(DEBUG_COIN_DECLARE_ONLY_PARAMS()); + bool addMissing(bool* added DEBUG_COIN_DECLARE_PARAMS()); bool addUncommon(); - bool apply(); + bool apply(DEBUG_COIN_DECLARE_ONLY_PARAMS()); bool contains(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd) const; - void correctEnds(); + void correctEnds(DEBUG_COIN_DECLARE_ONLY_PARAMS()); -#if DEBUG_COINCIDENCE_VERBOSE - void debugAddExpanded(const char* id, SkPathOpsDebug::GlitchLog* ) const; - void debugAddMissing(const char* id, SkPathOpsDebug::GlitchLog* , bool* added) const; - void debugAddOrOverlap(const char* id, SkPathOpsDebug::GlitchLog* log, +#if DEBUG_COIN + void debugAddEndMovedSpans(SkPathOpsDebug::GlitchLog* log) const; + void debugAddExpanded(SkPathOpsDebug::GlitchLog* ) const; + void debugAddMissing(SkPathOpsDebug::GlitchLog* , bool* added) const; + void debugAddOrOverlap(SkPathOpsDebug::GlitchLog* log, const SkOpSegment* coinSeg, const SkOpSegment* oppSeg, double coinTs, double coinTe, double oppTs, double oppTe, bool* added) const; @@ -170,20 +177,21 @@ public: void debugCheckBetween() const; -#if DEBUG_COINCIDENCE_VERBOSE - void debugCheckValid(const char* id, SkPathOpsDebug::GlitchLog* log) const; +#if DEBUG_COIN + void debugCheckValid(SkPathOpsDebug::GlitchLog* log) const; #endif SkOpContour* debugContour(int id) const { return SkDEBUGRELEASE(fGlobalState->debugContour(id), nullptr); } -#if DEBUG_COINCIDENCE_VERBOSE - bool debugExpand(const char* id, SkPathOpsDebug::GlitchLog* ) const; - void debugMark(const char* id, SkPathOpsDebug::GlitchLog* ) const; - void debugMarkCollapsed(const char* id, SkPathOpsDebug::GlitchLog* , +#if DEBUG_COIN + void debugCorrectEnds(SkPathOpsDebug::GlitchLog* log) const; + bool debugExpand(SkPathOpsDebug::GlitchLog* ) const; + void debugMark(SkPathOpsDebug::GlitchLog* ) const; + void debugMarkCollapsed(SkPathOpsDebug::GlitchLog* , const SkCoincidentSpans* coin, const SkOpPtT* test) const; - void debugMarkCollapsed(const char* id, SkPathOpsDebug::GlitchLog* , const SkOpPtT* test) const; + void debugMarkCollapsed(SkPathOpsDebug::GlitchLog* , const SkOpPtT* test) const; #endif const SkOpPtT* debugPtT(int id) const { @@ -194,12 +202,11 @@ public: return SkDEBUGRELEASE(fGlobalState->debugSegment(id), nullptr); } -#if DEBUG_COINCIDENCE_VERBOSE - void debugRemoveCollapsed(const char* id, SkPathOpsDebug::GlitchLog* ) const; - void debugReorder(const char* id, SkPathOpsDebug::GlitchLog* ) const; - void debugRelease(const char* id, SkPathOpsDebug::GlitchLog* , const SkCoincidentSpans* , +#if DEBUG_COIN + void debugRemoveCollapsed(SkPathOpsDebug::GlitchLog* ) const; + void debugRelease(SkPathOpsDebug::GlitchLog* , const SkCoincidentSpans* , const SkCoincidentSpans* ) const; - void debugRelease(const char* id, SkPathOpsDebug::GlitchLog* , const SkOpSegment* ) const; + void debugRelease(SkPathOpsDebug::GlitchLog* , const SkOpSegment* ) const; #endif void debugShowCoincidence() const; @@ -210,10 +217,10 @@ public: void debugValidate() const; void dump() const; bool edge(const SkOpPtT* , bool* start) const; - bool expand(); + bool expand(DEBUG_COIN_DECLARE_ONLY_PARAMS()); bool extend(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd); - bool findOverlaps(SkOpCoincidence* ) const; + bool findOverlaps(SkOpCoincidence* DEBUG_COIN_DECLARE_PARAMS()) const; void fixUp(SkOpPtT* deleted, const SkOpPtT* kept); SkOpGlobalState* globalState() { @@ -228,7 +235,7 @@ public: return !fHead && !fTop; } - bool mark(); + bool mark(DEBUG_COIN_DECLARE_ONLY_PARAMS()); void markCollapsed(SkOpPtT* ); static bool Ordered(const SkOpPtT* coinPtTStart, const SkOpPtT* oppPtTStart) { @@ -238,8 +245,6 @@ public: static bool Ordered(const SkOpSegment* coin, const SkOpSegment* opp); void release(const SkOpSegment* ); void releaseDeleted(); - bool removeCollapsed(); - bool reorder(); private: void add(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd, const SkOpPtT* oppPtTStart, @@ -276,15 +281,19 @@ private: bool contains(const SkOpSegment* seg, const SkOpSegment* opp, double oppT) const; bool contains(const SkCoincidentSpans* coin, const SkOpSegment* seg, const SkOpSegment* opp, double oppT) const; -#if DEBUG_COINCIDENCE_VERBOSE - void debugAddIfMissing(const char* id, SkPathOpsDebug::GlitchLog* , +#if DEBUG_COIN + void debugAddIfMissing(SkPathOpsDebug::GlitchLog* , const SkCoincidentSpans* outer, const SkOpPtT* over1s, const SkOpPtT* over1e) const; - void debugAddIfMissing(const char* id, SkPathOpsDebug::GlitchLog* , + void debugAddIfMissing(SkPathOpsDebug::GlitchLog* , const SkOpPtT* over1s, const SkOpPtT* over2s, double tStart, double tEnd, const SkOpSegment* coinSeg, const SkOpSegment* oppSeg, bool* added, const SkOpPtT* over1e, const SkOpPtT* over2e) const; + void debugAddEndMovedSpans(SkPathOpsDebug::GlitchLog* , + const SkOpSpan* base, const SkOpSpanBase* testSpan) const; + void debugAddEndMovedSpans(SkPathOpsDebug::GlitchLog* , + const SkOpPtT* ptT) const; #endif void fixUp(SkCoincidentSpans* coin, SkOpPtT* deleted, const SkOpPtT* kept); void markCollapsed(SkCoincidentSpans* head, SkOpPtT* test); |