aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-03-24 09:16:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-24 09:16:25 -0700
commitc207f9b2e8d6fb5386197fa8a8d258d2c4603418 (patch)
treefad704a7b03616bbe484ed182d7b287ce435dfd7
parente02c944e97ad6a3b8befb1f4f784919767941ba6 (diff)
fix destructor order to fix build
-rw-r--r--src/pathops/SkOpContour.h10
-rw-r--r--src/pathops/SkPathOpsCommon.cpp2
-rw-r--r--src/pathops/SkPathOpsOp.cpp2
-rw-r--r--src/pathops/SkPathOpsSimplify.cpp2
-rw-r--r--src/pathops/SkPathOpsTightBounds.cpp2
-rw-r--r--tests/PathOpsAngleTest.cpp2
6 files changed, 13 insertions, 7 deletions
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h
index be1f59f4bb..495b643fff 100644
--- a/src/pathops/SkOpContour.h
+++ b/src/pathops/SkOpContour.h
@@ -20,6 +20,12 @@ public:
reset();
}
+ ~SkOpContour() {
+ if (fNext) {
+ fNext->~SkOpContour();
+ }
+ }
+
bool operator<(const SkOpContour& rh) const {
return fBounds.fTop == rh.fBounds.fTop
? fBounds.fLeft < rh.fBounds.fLeft
@@ -61,7 +67,7 @@ public:
SkOpContour* appendContour(SkChunkAlloc* allocator) {
SkOpContour* contour = SkOpTAllocator<SkOpContour>::New(allocator);
-
+ contour->setNext(NULL);
SkOpContour* prev = this;
SkOpContour* next;
while ((next = prev->next())) {
@@ -273,7 +279,7 @@ public:
}
void setNext(SkOpContour* contour) {
- SkASSERT(!fNext == !!contour);
+// SkASSERT(!fNext == !!contour);
fNext = contour;
}
diff --git a/src/pathops/SkPathOpsCommon.cpp b/src/pathops/SkPathOpsCommon.cpp
index b0fd822a9d..1dc171caf3 100644
--- a/src/pathops/SkPathOpsCommon.cpp
+++ b/src/pathops/SkPathOpsCommon.cpp
@@ -440,12 +440,12 @@ public:
reassemble contour pieces into new path
*/
void Assemble(const SkPathWriter& path, SkPathWriter* simple) {
+ SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
SkOpContour contour;
SkOpGlobalState globalState(NULL PATH_OPS_DEBUG_PARAMS(&contour));
#if DEBUG_PATH_CONSTRUCTION
SkDebugf("%s\n", __FUNCTION__);
#endif
- SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
builder.finish(&allocator);
SkTDArray<const SkOpContour* > runs; // indices of partial contours
diff --git a/src/pathops/SkPathOpsOp.cpp b/src/pathops/SkPathOpsOp.cpp
index 77ae2de778..3182ac363d 100644
--- a/src/pathops/SkPathOpsOp.cpp
+++ b/src/pathops/SkPathOpsOp.cpp
@@ -261,6 +261,7 @@ static void dump_op(const SkPath& one, const SkPath& two, SkPathOp op) {
#endif
bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) {
+ SkChunkAlloc allocator(4096); // FIXME: add a constant expression here, tune
SkOpContour contour;
SkOpCoincidence coincidence;
SkOpGlobalState globalState(&coincidence PATH_OPS_DEBUG_PARAMS(&contour));
@@ -288,7 +289,6 @@ bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) {
SkPathOpsDebug::gSortCount = SkPathOpsDebug::gSortCountDefault;
#endif
// turn path into list of segments
- SkChunkAlloc allocator(4096); // FIXME: add a constant expression here, tune
SkOpEdgeBuilder builder(*minuend, &contour, &allocator, &globalState);
if (builder.unparseable()) {
return false;
diff --git a/src/pathops/SkPathOpsSimplify.cpp b/src/pathops/SkPathOpsSimplify.cpp
index 7a234ecb01..5c8a7fd840 100644
--- a/src/pathops/SkPathOpsSimplify.cpp
+++ b/src/pathops/SkPathOpsSimplify.cpp
@@ -177,6 +177,7 @@ static bool bridgeXor(SkTDArray<SkOpContour* >& contourList, SkPathWriter* simpl
// FIXME : add this as a member of SkPath
bool Simplify(const SkPath& path, SkPath* result) {
+ SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
// returns 1 for evenodd, -1 for winding, regardless of inverse-ness
SkPath::FillType fillType = path.isInverseFillType() ? SkPath::kInverseEvenOdd_FillType
: SkPath::kEvenOdd_FillType;
@@ -194,7 +195,6 @@ bool Simplify(const SkPath& path, SkPath* result) {
#if DEBUG_SORT || DEBUG_SWAP_TOP
SkPathOpsDebug::gSortCount = SkPathOpsDebug::gSortCountDefault;
#endif
- SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
if (!builder.finish(&allocator)) {
return false;
diff --git a/src/pathops/SkPathOpsTightBounds.cpp b/src/pathops/SkPathOpsTightBounds.cpp
index d03efeb173..2f09f412f2 100644
--- a/src/pathops/SkPathOpsTightBounds.cpp
+++ b/src/pathops/SkPathOpsTightBounds.cpp
@@ -8,10 +8,10 @@
#include "SkPathOpsCommon.h"
bool TightBounds(const SkPath& path, SkRect* result) {
+ SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
SkOpContour contour;
SkOpGlobalState globalState( NULL PATH_OPS_DEBUG_PARAMS(&contour));
// turn path into list of segments
- SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
if (!builder.finish(&allocator)) {
return false;
diff --git a/tests/PathOpsAngleTest.cpp b/tests/PathOpsAngleTest.cpp
index db3e8644f1..62ebc10139 100644
--- a/tests/PathOpsAngleTest.cpp
+++ b/tests/PathOpsAngleTest.cpp
@@ -233,10 +233,10 @@ static CircleData circleDataSet[] = {
static const int circleDataSetSize = (int) SK_ARRAY_COUNT(circleDataSet);
DEF_TEST(PathOpsAngleCircle, reporter) {
+ SkChunkAlloc allocator(4096);
SkOpContour contour;
SkOpGlobalState state(NULL PATH_OPS_DEBUG_PARAMS(&contour));
contour.init(&state, false, false);
- SkChunkAlloc allocator(4096);
for (int index = 0; index < circleDataSetSize; ++index) {
CircleData& data = circleDataSet[index];
for (int idx2 = 0; idx2 < data.fPtCount; ++idx2) {