Index: src/pathops/SkOpEdgeBuilder.h |
diff --git a/src/pathops/SkOpEdgeBuilder.h b/src/pathops/SkOpEdgeBuilder.h |
index fd0744572d9bc256df276bc5feb1acc136b61a9d..3ecc915833137b173547b18dee07ee0171ea30f4 100644 |
--- a/src/pathops/SkOpEdgeBuilder.h |
+++ b/src/pathops/SkOpEdgeBuilder.h |
@@ -9,20 +9,25 @@ |
#include "SkOpContour.h" |
#include "SkPathWriter.h" |
-#include "SkTArray.h" |
class SkOpEdgeBuilder { |
public: |
- SkOpEdgeBuilder(const SkPathWriter& path, SkTArray<SkOpContour>& contours) |
- : fPath(path.nativePath()) |
- , fContours(contours) |
+ SkOpEdgeBuilder(const SkPathWriter& path, SkOpContour* contours2, SkChunkAlloc* allocator, |
+ SkOpGlobalState* globalState) |
+ : fAllocator(allocator) // FIXME: replace with const, tune this |
+ , fGlobalState(globalState) |
+ , fPath(path.nativePath()) |
+ , fContoursHead(contours2) |
, fAllowOpenContours(true) { |
init(); |
} |
- SkOpEdgeBuilder(const SkPath& path, SkTArray<SkOpContour>& contours) |
- : fPath(&path) |
- , fContours(contours) |
+ SkOpEdgeBuilder(const SkPath& path, SkOpContour* contours2, SkChunkAlloc* allocator, |
+ SkOpGlobalState* globalState) |
+ : fAllocator(allocator) |
+ , fGlobalState(globalState) |
+ , fPath(&path) |
+ , fContoursHead(contours2) |
, fAllowOpenContours(false) { |
init(); |
} |
@@ -30,13 +35,19 @@ public: |
void addOperand(const SkPath& path); |
void complete() { |
- if (fCurrentContour && fCurrentContour->segments().count()) { |
+ if (fCurrentContour && fCurrentContour->count()) { |
fCurrentContour->complete(); |
fCurrentContour = NULL; |
} |
} |
- bool finish(); |
+ int count() const; |
+ bool finish(SkChunkAlloc* ); |
+ |
+ const SkOpContour* head() const { |
+ return fContoursHead; |
+ } |
+ |
void init(); |
bool unparseable() const { return fUnparseable; } |
SkPathOpsMask xorMask() const { return fXorMask[fOperand]; } |
@@ -45,13 +56,15 @@ private: |
void closeContour(const SkPoint& curveEnd, const SkPoint& curveStart); |
bool close(); |
int preFetch(); |
- bool walk(); |
+ bool walk(SkChunkAlloc* ); |
+ SkChunkAlloc* fAllocator; |
+ SkOpGlobalState* fGlobalState; |
const SkPath* fPath; |
- SkTArray<SkPoint, true> fPathPts; |
- SkTArray<uint8_t, true> fPathVerbs; |
+ SkTDArray<SkPoint> fPathPts; |
+ SkTDArray<uint8_t> fPathVerbs; |
SkOpContour* fCurrentContour; |
- SkTArray<SkOpContour>& fContours; |
+ SkOpContour* fContoursHead; |
SkPathOpsMask fXorMask[2]; |
int fSecondHalf; |
bool fOperand; |