diff options
author | Herb Derby <herb@google.com> | 2017-02-08 15:12:19 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-08 21:08:02 +0000 |
commit | 73fe7b07e6391da81dfc48d600d7b3141be1f471 (patch) | |
tree | 34df5836e6c9360d69a9da9293cd2823d316191a /src/core/SkDrawLooper.cpp | |
parent | 16c149664d3f95e1cabded8a1b7b3d105222c236 (diff) |
Remove use of SkSmallAllocator from all Loopers.
R=reed@google.com
Change-Id: I22b140ee8e12900de13bc623adb30b5fca3051f9
Reviewed-on: https://skia-review.googlesource.com/7658
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkDrawLooper.cpp')
-rw-r--r-- | src/core/SkDrawLooper.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/core/SkDrawLooper.cpp b/src/core/SkDrawLooper.cpp index e372e8f157..54c9af19fa 100644 --- a/src/core/SkDrawLooper.cpp +++ b/src/core/SkDrawLooper.cpp @@ -5,22 +5,19 @@ * found in the LICENSE file. */ +#include "SkArenaAlloc.h" #include "SkDrawLooper.h" #include "SkCanvas.h" #include "SkMatrix.h" #include "SkPaint.h" #include "SkRect.h" -#include "SkSmallAllocator.h" bool SkDrawLooper::canComputeFastBounds(const SkPaint& paint) const { SkCanvas canvas; - SkSmallAllocator<1, 32> allocator; + char storage[48]; + SkArenaAlloc alloc {storage}; - SkDrawLooper::Context* context = allocator.createWithIniter( - this->contextSize(), - [&](void* buffer) { - return this->createContext(&canvas, buffer); - }); + SkDrawLooper::Context* context = this->makeContext(&canvas, &alloc); for (;;) { SkPaint p(paint); if (context->next(&canvas, &p)) { @@ -41,14 +38,12 @@ void SkDrawLooper::computeFastBounds(const SkPaint& paint, const SkRect& s, const SkRect src = s; SkCanvas canvas; - SkSmallAllocator<1, 32> allocator; + char storage[48]; + SkArenaAlloc alloc {storage}; *dst = src; // catch case where there are no loops - SkDrawLooper::Context* context = allocator.createWithIniter( - this->contextSize(), - [&](void* buffer) { - return this->createContext(&canvas, buffer); - }); + SkDrawLooper::Context* context = this->makeContext(&canvas, &alloc); + for (bool firstTime = true;; firstTime = false) { SkPaint p(paint); if (context->next(&canvas, &p)) { |