Index: src/pathops/SkOpSegment.h |
=================================================================== |
--- src/pathops/SkOpSegment.h (revision 9425) |
+++ src/pathops/SkOpSegment.h (working copy) |
@@ -8,6 +8,7 @@ |
#define SkOpSegment_DEFINE |
#include "SkOpAngle.h" |
+#include "SkOpSpan.h" |
#include "SkPathOpsBounds.h" |
#include "SkPathOpsCurve.h" |
#include "SkTDArray.h" |
@@ -40,6 +41,10 @@ |
return count > 1 && fTs[0].fT == 0 && fTs[--count].fT == 1; |
} |
+ int count() const { |
+ return fTs.count(); |
+ } |
+ |
bool done() const { |
SkASSERT(fDoneSpans <= fTs.count()); |
return fDoneSpans == fTs.count(); |
@@ -120,6 +125,10 @@ |
return fTs[lesser].fOppValue; |
} |
+ const SkOpSegment* other(int index) const { |
+ return fTs[index].fOther; |
+ } |
+ |
const SkPoint* pts() const { |
return fPts; |
} |
@@ -262,6 +271,8 @@ |
bool isLinear(int start, int end) const; |
bool isMissing(double startT) const; |
bool isSimple(int end) const; |
+ bool isTiny(const SkOpAngle* angle) const; |
+ bool isTiny(int index) const; |
SkOpSpan* markAndChaseDoneBinary(int index, int endIndex); |
SkOpSpan* markAndChaseDoneUnary(int index, int endIndex); |
SkOpSpan* markAndChaseWinding(const SkOpAngle* angle, int winding, int oppWinding); |
@@ -279,8 +290,14 @@ |
int nextSpan(int from, int step) const; |
void setUpWindings(int index, int endIndex, int* sumMiWinding, int* sumSuWinding, |
int* maxWinding, int* sumWinding, int* oppMaxWinding, int* oppSumWinding); |
- static bool SortAngles(const SkTDArray<SkOpAngle>& angles, SkTDArray<SkOpAngle*>* angleList); |
- void subDivide(int start, int end, SkPoint edge[4]) const; |
+ enum SortAngleKind { |
+ kMustBeOrdered_SortAngleKind, // required for winding calc |
+ kMayBeUnordered_SortAngleKind // ok for find top |
+ }; |
+ static bool SortAngles(const SkTDArray<SkOpAngle>& angles, SkTDArray<SkOpAngle*>* angleList, |
+ SortAngleKind ); |
+ bool subDivide(int start, int end, SkPoint edge[4]) const; |
+ bool subDivide(int start, int end, SkDCubic* result) const; |
void undoneSpan(int* start, int* end); |
int updateOppWindingReverse(const SkOpAngle* angle) const; |
int updateWindingReverse(const SkOpAngle* angle) const; |
@@ -348,7 +365,6 @@ |
SkOpSegment* nextChase(int* index, const int step, int* min, SkOpSpan** last); |
bool serpentine(int tStart, int tEnd) const; |
void subDivideBounds(int start, int end, SkPathOpsBounds* bounds) const; |
- bool tiny(const SkOpAngle* angle) const; |
static void TrackOutside(SkTDArray<double>* outsideTs, double end, double start); |
int updateOppWinding(int index, int endIndex) const; |
int updateOppWinding(const SkOpAngle* angle) const; |