aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkOpSegment.h
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/SkOpSegment.h
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/SkOpSegment.h')
-rw-r--r--src/pathops/SkOpSegment.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/pathops/SkOpSegment.h b/src/pathops/SkOpSegment.h
index 13b99c6f46..1162c2cfaf 100644
--- a/src/pathops/SkOpSegment.h
+++ b/src/pathops/SkOpSegment.h
@@ -33,11 +33,11 @@ public:
}
SkOpAngle* activeAngle(SkOpSpanBase* start, SkOpSpanBase** startPtr, SkOpSpanBase** endPtr,
- bool* done, bool* sortable);
+ bool* done);
SkOpAngle* activeAngleInner(SkOpSpanBase* start, SkOpSpanBase** startPtr,
- SkOpSpanBase** endPtr, bool* done, bool* sortable);
+ SkOpSpanBase** endPtr, bool* done);
SkOpAngle* activeAngleOther(SkOpSpanBase* start, SkOpSpanBase** startPtr,
- SkOpSpanBase** endPtr, bool* done, bool* sortable);
+ SkOpSpanBase** endPtr, bool* done);
bool activeOp(SkOpSpanBase* start, SkOpSpanBase* end, int xorMiMask, int xorSuMask,
SkPathOp op);
bool activeOp(int xorMiMask, int xorSuMask, SkOpSpanBase* start, SkOpSpanBase* end, SkPathOp op,
@@ -110,6 +110,7 @@ public:
void calcAngles(SkChunkAlloc*);
void checkAngleCoin(SkOpCoincidence* coincidences, SkChunkAlloc* allocator);
void checkNearCoincidence(SkOpAngle* );
+ bool collapsed() const;
static void ComputeOneSum(const SkOpAngle* baseAngle, SkOpAngle* nextAngle,
SkOpAngle::IncludeType );
static void ComputeOneSumReverse(SkOpAngle* baseAngle, SkOpAngle* nextAngle,
@@ -306,11 +307,8 @@ public:
fPrev = prev;
}
- bool setVisited() {
- if (fVisited) {
- return false;
- }
- return (fVisited = true);
+ void setVisited() {
+ fVisited = true;
}
void setUpWinding(SkOpSpanBase* start, SkOpSpanBase* end, int* maxWinding, int* sumWinding) {
@@ -361,6 +359,15 @@ public:
return fVerb;
}
+ // look for two different spans that point to the same opposite segment
+ bool visited() {
+ if (!fVisited) {
+ fVisited = true;
+ return false;
+ }
+ return true;
+ }
+
SkScalar weight() const {
return fWeight;
}