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

Unified Diff: src/pathops/SkOpSpan.h

Issue 2273293004: path ops stream-lining (Closed)
Patch Set: remove commented out 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 ebcc984b33fd0346591e7bd3fb6820f80324bacc..96a97e07320547466d2c12b7f436113ba2055114 100644
--- a/src/pathops/SkOpSpan.h
+++ b/src/pathops/SkOpSpan.h
@@ -29,24 +29,12 @@ public:
};
// please keep in sync with debugAddOpp()
- bool addOpp(SkOpPtT* opp) {
- // find the fOpp ptr to opp
- SkOpPtT* oppPrev = opp->fNext;
- if (oppPrev == this) {
- return false;
- }
- while (oppPrev->fNext != opp) {
- oppPrev = oppPrev->fNext;
- if (oppPrev == this) {
- return false;
- }
- }
+ void addOpp(SkOpPtT* opp, SkOpPtT* oppPrev) {
SkOpPtT* oldNext = this->fNext;
SkASSERT(this != opp);
this->fNext = opp;
SkASSERT(oppPrev != oldNext);
oppPrev->fNext = oldNext;
- return true;
}
bool alias() const;
@@ -62,7 +50,7 @@ public:
return SkDEBUGRELEASE(fID, -1);
}
- bool debugAddOpp(const SkOpPtT* opp) const;
+ void debugAddOpp(const SkOpPtT* opp, const SkOpPtT* oppPrev) const;
const SkOpAngle* debugAngle(int id) const;
const SkOpCoincidence* debugCoincidence() const;
bool debugContains(const SkOpPtT* ) const;
@@ -70,6 +58,7 @@ public:
SkOpContour* debugContour(int id);
int debugLoopLimit(bool report) const;
bool debugMatchID(int id) const;
+ const SkOpPtT* debugOppPrev(const SkOpPtT* opp) const;
const SkOpPtT* debugPtT(int id) const;
void debugResetCoinT() const;
const SkOpSegment* debugSegment(int id) const;
@@ -109,6 +98,21 @@ public:
bool onEnd() const;
+ SkOpPtT* oppPrev(SkOpPtT* opp) const {
+ // find the fOpp ptr to opp
+ SkOpPtT* oppPrev = opp->fNext;
+ if (oppPrev == this) {
+ return nullptr;
+ }
+ while (oppPrev->fNext != opp) {
+ oppPrev = oppPrev->fNext;
+ if (oppPrev == this) {
+ return nullptr;
+ }
+ }
+ return oppPrev;
+ }
+
static bool Overlaps(const SkOpPtT* s1, const SkOpPtT* e1, const SkOpPtT* s2,
const SkOpPtT* e2, const SkOpPtT** sOut, const SkOpPtT** eOut) {
const SkOpPtT* start1 = s1->fT < e1->fT ? s1 : e1;
« 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