Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(934)

Unified Diff: src/pathops/SkOpEdgeBuilder.h

Issue 1037573004: cumulative pathops patch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix pathopsinverse gm Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkOpContour.cpp ('k') | src/pathops/SkOpEdgeBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/pathops/SkOpContour.cpp ('k') | src/pathops/SkOpEdgeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698