Index: src/pathops/SkOpContour.h |
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h |
index 456e6c0068bc2c7e1ffec342fa680c5b3337c6ef..a5635fe3d2b59b083dcb5801df931fa71de103ac 100644 |
--- a/src/pathops/SkOpContour.h |
+++ b/src/pathops/SkOpContour.h |
@@ -15,7 +15,7 @@ class SkOpContour; |
class SkPathWriter; |
struct SkCoincidence { |
- SkOpContour* fContours[2]; |
+ SkOpContour* fOther; |
int fSegments[2]; |
double fTs[2][2]; |
SkPoint fPts[2]; |
@@ -25,8 +25,8 @@ class SkOpContour { |
public: |
SkOpContour() { |
reset(); |
-#if DEBUG_DUMP |
- fID = ++gContourID; |
+#ifdef SK_DEBUG |
+ fID = ++SkPathOpsDebug::gContourID; |
#endif |
} |
@@ -63,15 +63,19 @@ public: |
fSegments[segIndex].addOtherT(tIndex, otherT, otherIndex); |
} |
+ void addPartialCoincident(int index, SkOpContour* other, int otherIndex, |
+ const SkIntersections& ts, int ptIndex, bool swap); |
+ |
int addQuad(const SkPoint pts[3]) { |
fSegments.push_back().addQuad(pts, fOperand, fXor); |
fContainsCurves = true; |
return fSegments.count(); |
} |
- int addT(int segIndex, SkOpContour* other, int otherIndex, const SkPoint& pt, double newT) { |
+ int addT(int segIndex, SkOpContour* other, int otherIndex, const SkPoint& pt, double newT, |
+ bool isNear) { |
setContainsIntercepts(); |
- return fSegments[segIndex].addT(&other->fSegments[otherIndex], pt, newT); |
+ return fSegments[segIndex].addT(&other->fSegments[otherIndex], pt, newT, isNear); |
} |
int addSelfT(int segIndex, SkOpContour* other, int otherIndex, const SkPoint& pt, double newT) { |
@@ -79,16 +83,12 @@ public: |
return fSegments[segIndex].addSelfT(&other->fSegments[otherIndex], pt, newT); |
} |
- int addUnsortableT(int segIndex, SkOpContour* other, int otherIndex, bool start, |
- const SkPoint& pt, double newT) { |
- return fSegments[segIndex].addUnsortableT(&other->fSegments[otherIndex], start, pt, newT); |
- } |
- |
const SkPathOpsBounds& bounds() const { |
return fBounds; |
} |
void calcCoincidentWinding(); |
+ void calcPartialCoincidentWinding(); |
void checkEnds() { |
if (!fContainsCurves) { |
@@ -100,7 +100,18 @@ public: |
if (segment->verb() == SkPath::kLine_Verb) { |
continue; |
} |
- fSegments[sIndex].checkEnds(); |
+ segment->checkEnds(); |
+ } |
+ } |
+ |
+ // if same point has different T values, choose a common T |
+ void checkTiny() { |
+ int segmentCount = fSegments.count(); |
+ if (segmentCount <= 2) { |
+ return; |
+ } |
+ for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { |
+ fSegments[sIndex].checkTiny(); |
} |
} |
@@ -131,13 +142,6 @@ public: |
return segment.pts()[SkPathOpsVerbToPoints(segment.verb())]; |
} |
- void findTooCloseToCall() { |
- int segmentCount = fSegments.count(); |
- for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { |
- fSegments[sIndex].findTooCloseToCall(); |
- } |
- } |
- |
void fixOtherTIndex() { |
int segmentCount = fSegments.count(); |
for (int sIndex = 0; sIndex < segmentCount; ++sIndex) { |
@@ -232,12 +236,14 @@ public: |
#endif |
private: |
+ void calcCommonCoincidentWinding(const SkCoincidence& coincidence); |
void setBounds(); |
SkTArray<SkOpSegment> fSegments; |
SkTArray<SkOpSegment*, true> fSortedSegments; |
int fFirstSorted; |
SkTArray<SkCoincidence, true> fCoincidences; |
+ SkTArray<SkCoincidence, true> fPartialCoincidences; |
SkTArray<const SkOpContour*, true> fCrosses; |
SkPathOpsBounds fBounds; |
bool fContainsIntercepts; // FIXME: is this used by anybody? |
@@ -247,7 +253,7 @@ private: |
bool fOperand; // true for the second argument to a binary operator |
bool fXor; |
bool fOppXor; |
-#if DEBUG_DUMP |
+#ifdef SK_DEBUG |
int fID; |
#endif |
}; |