Revert of fix destructor order to fix build (patchset #1 id:1 of https://codereview.chromium.org/1033703002/)

Reason for revert:
working on asan fix

Original issue's description:
> fix destructor order to fix build
>
> TBR=reed
>
> Committed: https://skia.googlesource.com/skia/+/c207f9b2e8d6fb5386197fa8a8d258d2c4603418

TBR=reed@android.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1033803002
This commit is contained in:
caryclark 2015-03-24 13:47:57 -07:00 committed by Commit bot
parent 7aa846c683
commit 74c464a6af
6 changed files with 7 additions and 13 deletions

View File

@ -20,12 +20,6 @@ public:
reset();
}
~SkOpContour() {
if (fNext) {
fNext->~SkOpContour();
}
}
bool operator<(const SkOpContour& rh) const {
return fBounds.fTop == rh.fBounds.fTop
? fBounds.fLeft < rh.fBounds.fLeft
@ -67,7 +61,7 @@ public:
SkOpContour* appendContour(SkChunkAlloc* allocator) {
SkOpContour* contour = SkOpTAllocator<SkOpContour>::New(allocator);
contour->setNext(NULL);
SkOpContour* prev = this;
SkOpContour* next;
while ((next = prev->next())) {
@ -279,7 +273,7 @@ public:
}
void setNext(SkOpContour* contour) {
// SkASSERT(!fNext == !!contour);
SkASSERT(!fNext == !!contour);
fNext = contour;
}

View File

@ -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

View File

@ -261,7 +261,6 @@ 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));
@ -289,6 +288,7 @@ 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;

View File

@ -177,7 +177,6 @@ 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;
@ -195,6 +194,7 @@ 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;

View File

@ -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;

View File

@ -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) {