aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsWinding.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-05-18 05:12:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-18 05:12:56 -0700
commit5b5ddd73b4baf22752924bf20d097e96236c36f8 (patch)
treee4ae4c9db97d4a19fe504b9aabf5f6d373aeeffa /src/pathops/SkPathOpsWinding.cpp
parent2e0303f91bdada6dddb73105a82f17601265379d (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/SkPathOpsWinding.cpp')
-rw-r--r--src/pathops/SkPathOpsWinding.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pathops/SkPathOpsWinding.cpp b/src/pathops/SkPathOpsWinding.cpp
index 53083e484e..4a7b1bc3eb 100644
--- a/src/pathops/SkPathOpsWinding.cpp
+++ b/src/pathops/SkPathOpsWinding.cpp
@@ -342,8 +342,12 @@ bool SkOpSpan::sortableTop(SkOpContour* contourHead) {
#endif
}
if (sumSet) {
- (void) hitSegment->markAndChaseWinding(span, span->next(), windSum, oppSum, NULL);
- (void) hitSegment->markAndChaseWinding(span->next(), span, windSum, oppSum, NULL);
+ if (this->globalState()->phase() == SkOpGlobalState::kFixWinding) {
+ hitSegment->contour()->setCcw(ccw);
+ } else {
+ (void) hitSegment->markAndChaseWinding(span, span->next(), windSum, oppSum, NULL);
+ (void) hitSegment->markAndChaseWinding(span->next(), span, windSum, oppSum, NULL);
+ }
}
if (operand) {
SkTSwap(wind, oppWind);