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

Unified Diff: src/pathops/SkOpContour.h

Issue 1129193006: fix winding for path ops builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile bug Created 5 years, 7 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/SkOpBuilder.cpp ('k') | src/pathops/SkOpContour.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpContour.h
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h
index dd5dbb40ca638bfab0af2e642ba76d56febcbcf3..f8143cf5550a30a20364824d3114015dd9cacf29 100644
--- a/src/pathops/SkOpContour.h
+++ b/src/pathops/SkOpContour.h
@@ -207,10 +207,21 @@ public:
SkDEBUGCODE(fID = globalState->nextContourID());
}
+ int isCcw() const {
+ return fCcw;
+ }
+
bool isXor() const {
return fXor;
}
+ void markDone() {
+ SkOpSegment* segment = &fHead;
+ do {
+ segment->markAllDone();
+ } while ((segment = segment->next()));
+ }
+
void missingCoincidence(SkOpCoincidence* coincidences, SkChunkAlloc* allocator) {
SkASSERT(fCount > 0);
SkOpSegment* segment = &fHead;
@@ -289,6 +300,18 @@ public:
SkDEBUGCODE(fDebugIndent = 0);
}
+ void resetReverse() {
+ SkOpContour* next = this;
+ do {
+ next->fCcw = -1;
+ next->fReverse = false;
+ } while ((next = next->next()));
+ }
+
+ bool reversed() const {
+ return fReverse;
+ }
+
void setBounds() {
SkASSERT(fCount > 0);
const SkOpSegment* segment = &fHead;
@@ -298,6 +321,10 @@ public:
}
}
+ void setCcw(int ccw) {
+ fCcw = ccw;
+ }
+
void setGlobalState(SkOpGlobalState* state) {
fState = state;
}
@@ -315,6 +342,10 @@ public:
fOppXor = isOppXor;
}
+ void setReverse() {
+ fReverse = true;
+ }
+
void setXor(bool isXor) {
fXor = isXor;
}
@@ -347,6 +378,7 @@ public:
} while ((segment = segment->next()));
}
+ void toReversePath(SkPathWriter* path) const;
void toPath(SkPathWriter* path) const;
SkOpSegment* undoneSegment(SkOpSpanBase** startPtr, SkOpSpanBase** endPtr);
@@ -356,11 +388,13 @@ private:
SkOpSegment* fTail;
SkOpContour* fNext;
SkPathOpsBounds fBounds;
+ int fCcw;
int fCount;
int fFirstSorted;
bool fDone; // set by find top segment
bool fTopsFound;
bool fOperand; // true for the second argument to a binary operator
+ bool fReverse; // true if contour should be reverse written to path (used only by fix winding)
bool fXor; // set if original path had even-odd fill
bool fOppXor; // set if opposite path had even-odd fill
SkDEBUGCODE(int fID);
« no previous file with comments | « src/pathops/SkOpBuilder.cpp ('k') | src/pathops/SkOpContour.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698