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

Unified Diff: src/pathops/SkOpSpan.h

Issue 2237223002: pathops coincident work (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused code Created 4 years, 4 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/SkOpSegment.cpp ('k') | src/pathops/SkOpSpan.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpSpan.h
diff --git a/src/pathops/SkOpSpan.h b/src/pathops/SkOpSpan.h
index 96a97e07320547466d2c12b7f436113ba2055114..7c7bf7c186482f42435f2af727c2bae983d18791 100644
--- a/src/pathops/SkOpSpan.h
+++ b/src/pathops/SkOpSpan.h
@@ -28,6 +28,8 @@ public:
kIsDuplicate = 1
};
+ const SkOpPtT* active() const;
+
// please keep in sync with debugAddOpp()
void addOpp(SkOpPtT* opp, SkOpPtT* oppPrev) {
SkOpPtT* oldNext = this->fNext;
@@ -55,7 +57,7 @@ public:
const SkOpCoincidence* debugCoincidence() const;
bool debugContains(const SkOpPtT* ) const;
const SkOpPtT* debugContains(const SkOpSegment* check) const;
- SkOpContour* debugContour(int id);
+ SkOpContour* debugContour(int id) const;
int debugLoopLimit(bool report) const;
bool debugMatchID(int id) const;
const SkOpPtT* debugOppPrev(const SkOpPtT* opp) const;
@@ -98,7 +100,8 @@ public:
bool onEnd() const;
- SkOpPtT* oppPrev(SkOpPtT* opp) const {
+ // returns nullptr if this is already in the opp ptT loop
+ SkOpPtT* oppPrev(const SkOpPtT* opp) const {
// find the fOpp ptr to opp
SkOpPtT* oppPrev = opp->fNext;
if (oppPrev == this) {
@@ -176,7 +179,8 @@ protected:
class SkOpSpanBase {
public:
- void addOppAndMerge(SkOpSpanBase* );
+ SkOpSpanBase* active();
+ void addOpp(SkOpSpanBase* opp);
void bumpSpanAdds() {
++fSpanAdds;
@@ -192,6 +196,7 @@ public:
return fCoinEnd;
}
+ bool collapsed(double s, double e) const;
bool contains(const SkOpSpanBase* ) const;
const SkOpPtT* contains(const SkOpSegment* ) const;
@@ -209,11 +214,6 @@ public:
bool containsCoinEnd(const SkOpSegment* ) const;
SkOpContour* contour() const;
-#if DEBUG_COINCIDENCE_VERBOSE
- void debugAddOppAndMerge(const char* id, SkPathOpsDebug::GlitchLog* , const SkOpSpanBase* ,
- bool* del1, bool* del2) const;
-#endif
-
int debugBumpCount() {
return SkDEBUGRELEASE(++fCount, -1);
}
@@ -222,6 +222,9 @@ public:
return SkDEBUGRELEASE(fID, -1);
}
+#if DEBUG_COINCIDENCE_VERBOSE
+ void debugAddOpp(const char* id, SkPathOpsDebug::GlitchLog* , const SkOpSpanBase* opp) const;
+#endif
bool debugAlignedEnd(double t, const SkPoint& pt) const;
bool debugAlignedInner() const;
const SkOpAngle* debugAngle(int id) const;
@@ -230,20 +233,25 @@ public:
#endif
const SkOpCoincidence* debugCoincidence() const;
bool debugCoinEndLoopCheck() const;
- SkOpContour* debugContour(int id);
+ SkOpContour* debugContour(int id) const;
#ifdef SK_DEBUG
- bool debugDeleted() const { return fDeleted; }
+ bool debugDeleted() const { return fDebugDeleted; }
#endif
#if DEBUG_COINCIDENCE_VERBOSE
void debugInsertCoinEnd(const char* id, SkPathOpsDebug::GlitchLog* ,
const SkOpSpanBase* ) const;
void debugMergeContained(const char* id, SkPathOpsDebug::GlitchLog* ,
const SkPathOpsBounds& bounds, bool* deleted) const;
+ void debugMergeMatches(const char* id, SkPathOpsDebug::GlitchLog* log,
+ const SkOpSpanBase* opp) const;
#endif
const SkOpPtT* debugPtT(int id) const;
void debugResetCoinT() const;
const SkOpSegment* debugSegment(int id) const;
void debugSetCoinT(int ) const;
+#ifdef SK_DEBUG
+ void debugSetDeleted() { fDebugDeleted = true; }
+#endif
const SkOpSpanBase* debugSpan(int id) const;
const SkOpSpan* debugStarter(SkOpSpanBase const** endPtr) const;
SkOpGlobalState* globalState() const;
@@ -285,6 +293,7 @@ public:
void merge(SkOpSpan* span);
void mergeContained(const SkPathOpsBounds& bounds);
+ void mergeMatches(SkOpSpanBase* opp);
const SkOpSpan* prev() const {
return fPrev;
@@ -403,7 +412,7 @@ protected: // no direct access to internals to avoid treating a span base as a
bool fChased; // set after span has been added to chase array
SkDEBUGCODE(int fCount); // number of pt/t pairs added
SkDEBUGCODE(int fID);
- SkDEBUGCODE(bool fDeleted); // set when span was merged with another span
+ SkDEBUGCODE(bool fDebugDeleted); // set when span was merged with another span
};
class SkOpSpan : public SkOpSpanBase {
@@ -445,15 +454,14 @@ public:
void debugInsertCoincidence(const char* , SkPathOpsDebug::GlitchLog* ,
const SkOpSegment* , bool flipped) const;
#endif
- void release(const SkOpPtT* );
+ void dumpCoin() const;
+ bool dumpSpan() const;
bool done() const {
SkASSERT(!final());
return fDone;
}
- void dumpCoin() const;
- bool dumpSpan() const;
void init(SkOpSegment* parent, SkOpSpan* prev, double t, const SkPoint& pt);
bool insertCoincidence(const SkOpSegment* , bool flipped);
@@ -496,6 +504,8 @@ public:
return fOppValue;
}
+ void release(const SkOpPtT* );
+
SkOpPtT* setCoinStart(SkOpSpan* oldCoinStart, SkOpSegment* oppSegment);
void setDone(bool done) {
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | src/pathops/SkOpSpan.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698