Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: src/pathops/SkOpCoincidence.h

Issue 1394503003: fix some pathops bugs found in 1M skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init to avoid warning Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpCoincidence.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpCoincidence.h
diff --git a/src/pathops/SkOpCoincidence.h b/src/pathops/SkOpCoincidence.h
index 86c6577739bd4979049386f920fc93d3601ae2c8..91da2e16bf559321f0500b9fb203329c23da351e 100644
--- a/src/pathops/SkOpCoincidence.h
+++ b/src/pathops/SkOpCoincidence.h
@@ -20,6 +20,11 @@ struct SkCoincidentSpans {
SkOpPtT* fOppPtTStart;
SkOpPtT* fOppPtTEnd;
bool fFlipped;
+ SkDEBUGCODE(int fID);
+
+ int debugID() const {
+ return SkDEBUGRELEASE(fID, -1);
+ }
void dump() const;
};
@@ -35,12 +40,14 @@ public:
void add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart,
SkOpPtT* oppPtTEnd, SkChunkAlloc* allocator);
- void addExpanded(SkChunkAlloc* allocator PATH_OPS_DEBUG_VALIDATE_PARAMS(SkOpGlobalState* ));
+ bool addExpanded(SkChunkAlloc* allocator PATH_OPS_DEBUG_VALIDATE_PARAMS(SkOpGlobalState* ));
bool addMissing(SkChunkAlloc* allocator);
- void addMissing(SkCoincidentSpans* check, SkChunkAlloc* allocator);
bool apply();
- bool contains(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart,
- SkOpPtT* oppPtTEnd, bool flipped);
+ bool contains(const SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd,
+ const SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd, bool flipped) const;
+
+ void debugAddExpanded(const char* id, SkPathOpsDebug::GlitchLog* ) const;
+ void debugAddMissing(const char* id, SkPathOpsDebug::GlitchLog* ) const;
const SkOpAngle* debugAngle(int id) const {
return SkDEBUGRELEASE(fDebugState->debugAngle(id), nullptr);
@@ -50,6 +57,9 @@ public:
return SkDEBUGRELEASE(fDebugState->debugContour(id), nullptr);
}
+ bool debugExpand(const char* id, SkPathOpsDebug::GlitchLog* ) const;
+ void debugMark(const char* id, SkPathOpsDebug::GlitchLog* ) const;
+
const SkOpPtT* debugPtT(int id) const {
return SkDEBUGRELEASE(fDebugState->debugPtT(id), nullptr);
}
@@ -62,6 +72,7 @@ public:
SkDEBUGCODE(fDebugState = debugState);
}
+ void debugFixAligned(const char* id, SkPathOpsDebug::GlitchLog* ) const;
void debugShowCoincidence() const;
const SkOpSpanBase* debugSpan(int id) const {
@@ -84,7 +95,7 @@ public:
void mark();
private:
- void addIfMissing(const SkCoincidentSpans* outer, SkOpPtT* over1s, SkOpPtT* over1e,
+ bool addIfMissing(const SkCoincidentSpans* outer, SkOpPtT* over1s, SkOpPtT* over1e,
SkChunkAlloc* );
bool addIfMissing(const SkOpPtT* over1s, const SkOpPtT* over1e,
const SkOpPtT* over2s, const SkOpPtT* over2e,
@@ -94,11 +105,19 @@ private:
SkChunkAlloc* );
void addOverlap(SkOpSegment* seg1, SkOpSegment* seg1o, SkOpSegment* seg2, SkOpSegment* seg2o,
SkOpPtT* overS, SkOpPtT* overE, SkChunkAlloc* );
+ bool debugAddIfMissing(const SkCoincidentSpans* outer, const SkOpPtT* over1s,
+ const SkOpPtT* over1e) const;
+ bool debugAddIfMissing(const SkOpPtT* over1s, const SkOpPtT* over1e,
+ const SkOpPtT* over2s, const SkOpPtT* over2e,
+ double tStart, double tEnd,
+ SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd,
+ SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd) const;
bool overlap(const SkOpPtT* coinStart1, const SkOpPtT* coinEnd1,
const SkOpPtT* coinStart2, const SkOpPtT* coinEnd2,
double* overS, double* overE) const;
- bool testForCoincidence(const SkCoincidentSpans* outer, SkOpPtT* testS, SkOpPtT* testE) const;
+ bool testForCoincidence(const SkCoincidentSpans* outer, const SkOpPtT* testS,
+ const SkOpPtT* testE) const;
SkCoincidentSpans* fHead;
SkCoincidentSpans* fTop;
SkDEBUGCODE_(SkOpGlobalState* fDebugState);
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpCoincidence.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698