diff options
author | Derek Sollenberger <djsollen@google.com> | 2017-03-07 11:14:59 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-07 11:15:10 +0000 |
commit | c0a4c4f969464ec9854d726836a430262351d63d (patch) | |
tree | e62c137641eb1002dbaa91c3b52335e23fbdf48f /src/pathops/SkPathOpsTSect.h | |
parent | f3b16d01e36574d1a0ddf73975a5f72963727aa4 (diff) |
Revert "Move from SkChunkAlloc to SkArenaAlloc for PathOps"
This reverts commit 38c60180241e335e368fdadbf7856aff114ff668.
Reason for revert: breaking ASAN run in TAP build
Original change's description:
> Move from SkChunkAlloc to SkArenaAlloc for PathOps
>
> Change-Id: Iab111a4ebcae4e896b1fdfe285def9ef0ae2ab6b
> Reviewed-on: https://skia-review.googlesource.com/7314
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
>
TBR=herb@google.com,caryclark@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I6364254571bb1617a9f45ed08f2af4a59f9d5841
Reviewed-on: https://skia-review.googlesource.com/9335
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Diffstat (limited to 'src/pathops/SkPathOpsTSect.h')
-rw-r--r-- | src/pathops/SkPathOpsTSect.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h index ef0799de4f..4f2480d62f 100644 --- a/src/pathops/SkPathOpsTSect.h +++ b/src/pathops/SkPathOpsTSect.h @@ -7,7 +7,7 @@ #ifndef SkPathOpsTSect_DEFINED #define SkPathOpsTSect_DEFINED -#include "SkArenaAlloc.h" +#include "SkChunkAlloc.h" #include "SkPathOpsBounds.h" #include "SkPathOpsRect.h" #include "SkIntersections.h" @@ -85,7 +85,7 @@ struct SkTSpanBounded { template<typename TCurve, typename OppCurve> class SkTSpan { public: - void addBounded(SkTSpan<OppCurve, TCurve>* , SkArenaAlloc* ); + void addBounded(SkTSpan<OppCurve, TCurve>* , SkChunkAlloc* ); double closestBoundedT(const SkDPoint& pt) const; bool contains(double t) const; @@ -174,11 +174,11 @@ public: initBounds(curve); } - bool split(SkTSpan* work, SkArenaAlloc* heap) { + bool split(SkTSpan* work, SkChunkAlloc* heap) { return splitAt(work, (work->fStartT + work->fEndT) * 0.5, heap); } - bool splitAt(SkTSpan* work, double t, SkArenaAlloc* heap); + bool splitAt(SkTSpan* work, double t, SkChunkAlloc* heap); double startT() const { return fStartT; @@ -317,7 +317,7 @@ private: void removeSpans(SkTSpan<TCurve, OppCurve>* span, SkTSect<OppCurve, TCurve>* opp); void removedEndCheck(SkTSpan<TCurve, OppCurve>* span); - void resetRemovedEnds() { + void resetRemovedEnds() { fRemovedStartT = fRemovedEndT = false; } @@ -331,7 +331,7 @@ private: void validateBounded() const; const TCurve& fCurve; - SkArenaAlloc fHeap; + SkChunkAlloc fHeap; SkTSpan<TCurve, OppCurve>* fHead; SkTSpan<TCurve, OppCurve>* fCoincident; SkTSpan<TCurve, OppCurve>* fDeleted; @@ -389,8 +389,9 @@ void SkTCoincident<TCurve, OppCurve>::setPerp(const TCurve& c1, double t, } template<typename TCurve, typename OppCurve> -void SkTSpan<TCurve, OppCurve>::addBounded(SkTSpan<OppCurve, TCurve>* span, SkArenaAlloc* heap) { - SkTSpanBounded<OppCurve, TCurve>* bounded = heap->make<SkTSpanBounded<OppCurve, TCurve>>(); +void SkTSpan<TCurve, OppCurve>::addBounded(SkTSpan<OppCurve, TCurve>* span, SkChunkAlloc* heap) { + SkTSpanBounded<OppCurve, TCurve>* bounded = new (heap->allocThrow( + sizeof(SkTSpanBounded<OppCurve, TCurve>)))(SkTSpanBounded<OppCurve, TCurve>); bounded->fBounded = span; bounded->fNext = fBounded; fBounded = bounded; @@ -755,7 +756,7 @@ bool SkTSpan<TCurve, OppCurve>::removeBounded(const SkTSpan<OppCurve, TCurve>* o } template<typename TCurve, typename OppCurve> -bool SkTSpan<TCurve, OppCurve>::splitAt(SkTSpan* work, double t, SkArenaAlloc* heap) { +bool SkTSpan<TCurve, OppCurve>::splitAt(SkTSpan* work, double t, SkChunkAlloc* heap) { fStartT = t; fEndT = work->fEndT; if (fStartT == fEndT) { @@ -857,7 +858,7 @@ void SkTSpan<TCurve, OppCurve>::validatePerpPt(double t, const SkDPoint& pt) con template<typename TCurve, typename OppCurve> -SkTSect<TCurve, OppCurve>::SkTSect(const TCurve& c +SkTSect<TCurve, OppCurve>::SkTSect(const TCurve& c SkDEBUGPARAMS(SkOpGlobalState* debugGlobalState) PATH_OPS_DEBUG_T_SECT_PARAMS(int id)) : fCurve(c) @@ -883,7 +884,8 @@ SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::addOne() { result = fDeleted; fDeleted = result->fNext; } else { - result = fHeap.make<SkTSpan<TCurve, OppCurve>>(); + result = new (fHeap.allocThrow(sizeof(SkTSpan<TCurve, OppCurve>)))( + SkTSpan<TCurve, OppCurve>); #if DEBUG_T_SECT ++fDebugAllocatedCount; #endif |