aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkOpSpan.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-05-13 08:23:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-13 08:23:48 -0700
commitbca19f77479adfd8ba2171753382bc8bf4c2b4ca (patch)
tree767104fcb63f7fab8901f7f7597a12bb78bf2e1e /src/pathops/SkOpSpan.cpp
parent04d24a3f86b6f2382e5c6ffaf161ffc734a4d02a (diff)
deal more consistently with unsortable edges
Improve line/curve coincident detection and resolution. This fixed the remaining simple failures. When an edge is unsortable, use the ray intersection to determine the angles' winding. Deal with degenerate segments. TBR=reed@google.com BUG=skia:3588,skia:3762 Review URL: https://codereview.chromium.org/1140813002
Diffstat (limited to 'src/pathops/SkOpSpan.cpp')
-rwxr-xr-xsrc/pathops/SkOpSpan.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pathops/SkOpSpan.cpp b/src/pathops/SkOpSpan.cpp
index 9c9e07f985..e89ec3e204 100755
--- a/src/pathops/SkOpSpan.cpp
+++ b/src/pathops/SkOpSpan.cpp
@@ -249,6 +249,16 @@ tryNextRemainder:
fSpanAdds += span->fSpanAdds;
}
+int SkOpSpan::computeWindSum() {
+ SkOpGlobalState* globals = this->globalState();
+ SkOpContour* contourHead = globals->contourHead();
+ int windTry = 0;
+ while (!this->sortableTop(contourHead) && ++windTry < SkOpGlobalState::kMaxWindingTries) {
+ ;
+ }
+ return this->windSum();
+}
+
bool SkOpSpan::containsCoincidence(const SkOpSegment* segment) const {
SkASSERT(this->segment() != segment);
const SkOpSpan* next = fCoincident;