aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkOpBuilder.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2017-03-01 16:48:12 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-06 19:48:56 +0000
commit38c60180241e335e368fdadbf7856aff114ff668 (patch)
tree46b5945d5390ee1296dfe0991209a2e3eb57d070 /src/pathops/SkOpBuilder.cpp
parentf12248ab10a8eba612b1cde8b1177de45bc712c7 (diff)
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>
Diffstat (limited to 'src/pathops/SkOpBuilder.cpp')
-rw-r--r--src/pathops/SkOpBuilder.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pathops/SkOpBuilder.cpp b/src/pathops/SkOpBuilder.cpp
index abff9827d5..c4eb0a91b5 100644
--- a/src/pathops/SkOpBuilder.cpp
+++ b/src/pathops/SkOpBuilder.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkArenaAlloc.h"
#include "SkMatrix.h"
#include "SkOpEdgeBuilder.h"
#include "SkPathPriv.h"
@@ -12,10 +13,10 @@
#include "SkPathOpsCommon.h"
static bool one_contour(const SkPath& path) {
- SkChunkAlloc allocator(256);
+ char storage[256];
+ SkArenaAlloc allocator(storage);
int verbCount = path.countVerbs();
- uint8_t* verbs = (uint8_t*) allocator.alloc(sizeof(uint8_t) * verbCount,
- SkChunkAlloc::kThrow_AllocFailType);
+ uint8_t* verbs = (uint8_t*) allocator.makeArrayDefault<uint8_t>(verbCount);
(void) path.getVerbs(verbs, verbCount);
for (int index = 1; index < verbCount; ++index) {
if (verbs[index] == SkPath::kMove_Verb) {
@@ -50,7 +51,8 @@ bool SkOpBuilder::FixWinding(SkPath* path) {
path->setFillType(fillType);
return true;
}
- SkChunkAlloc allocator(4096);
+ char storage[4096];
+ SkArenaAlloc allocator(storage);
SkOpContourHead contourHead;
SkOpGlobalState globalState(&contourHead, &allocator SkDEBUGPARAMS(false)
SkDEBUGPARAMS(nullptr));