diff options
author | caryclark <caryclark@google.com> | 2015-05-18 05:12:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-18 05:12:56 -0700 |
commit | 5b5ddd73b4baf22752924bf20d097e96236c36f8 (patch) | |
tree | e4ae4c9db97d4a19fe504b9aabf5f6d373aeeffa /src/pathops/SkPathOpsTypes.h | |
parent | 2e0303f91bdada6dddb73105a82f17601265379d (diff) |
The path ops builder code needs to determine the winding of each contour added, and reverse windings if the contours are nested in other contours.
Cheap (one contour) paths can be evaluated and reversed as needed with a minimum of checking, but multi-contour paths invoke the regular path ops machinery to determine who is contained by whom.
More tests need to be added to verify that all corner cases are considered, but this fixes the cases in the bug thus far.
R=fmalita@chromium.org
TBR=reed@google.com
BUG=skia:3838
Review URL: https://codereview.chromium.org/1129193006
Diffstat (limited to 'src/pathops/SkPathOpsTypes.h')
-rw-r--r-- | src/pathops/SkPathOpsTypes.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/pathops/SkPathOpsTypes.h b/src/pathops/SkPathOpsTypes.h index 845288f609..a780a88c6d 100644 --- a/src/pathops/SkPathOpsTypes.h +++ b/src/pathops/SkPathOpsTypes.h @@ -33,9 +33,7 @@ public: , fContourHead(head) , fWindingFailed(false) , fAngleCoincidence(false) -#if DEBUG_VALIDATE , fPhase(kIntersecting) -#endif SkDEBUGPARAMS(fAngleID(0)) SkDEBUGPARAMS(fContourID(0)) SkDEBUGPARAMS(fPtTID(0)) @@ -43,12 +41,11 @@ public: SkDEBUGPARAMS(fSpanID(0)) { } -#if DEBUG_VALIDATE enum Phase { kIntersecting, - kWalking + kWalking, + kFixWinding, }; -#endif enum { kMaxWindingTries = 10 @@ -93,11 +90,9 @@ public: } #endif -#if DEBUG_VALIDATE Phase phase() const { return fPhase; } -#endif void setAngleCoincidence() { fAngleCoincidence = true; @@ -107,12 +102,10 @@ public: fContourHead = contourHead; } -#if DEBUG_VALIDATE void setPhase(Phase phase) { SkASSERT(fPhase != phase); fPhase = phase; } -#endif // called in very rare cases where angles are sorted incorrectly -- signfies op will fail void setWindingFailed() { @@ -128,9 +121,7 @@ private: SkOpContourHead* fContourHead; bool fWindingFailed; bool fAngleCoincidence; -#if DEBUG_VALIDATE Phase fPhase; -#endif #ifdef SK_DEBUG int fAngleID; int fContourID; |