diff options
author | 2017-02-06 15:26:09 -0500 | |
---|---|---|
committer | 2017-02-07 15:43:45 +0000 | |
commit | 2b57b7f7a7fc97db57f190b5a8ebcf68e177ee2d (patch) | |
tree | 9b50da8887f7826d7f7f83ecab7f30eaddb7d7cf /src/core/SkColorFilterShader.cpp | |
parent | e970d5965d041a9f67de7f49a0e27b9f1f6554a6 (diff) |
Use SkArenaAlloc instead of SkSmallAllocator in the SkAutoBlitterChoose code.
TBR=reed@google.com
Change-Id: Iefb044bf7657fbf982f23aa91a3f4d013ce2c626
Reviewed-on: https://skia-review.googlesource.com/7786
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkColorFilterShader.cpp')
-rw-r--r-- | src/core/SkColorFilterShader.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/core/SkColorFilterShader.cpp b/src/core/SkColorFilterShader.cpp index 4090a18b45..5e96b24b41 100644 --- a/src/core/SkColorFilterShader.cpp +++ b/src/core/SkColorFilterShader.cpp @@ -5,6 +5,7 @@ * found in the LICENSE file. */ +#include "SkArenaAlloc.h" #include "SkColorFilterShader.h" #include "SkReadBuffer.h" #include "SkWriteBuffer.h" @@ -52,19 +53,15 @@ uint32_t SkColorFilterShader::FilterShaderContext::getFlags() const { return shaderF; } -SkShader::Context* SkColorFilterShader::onCreateContext(const ContextRec& rec, - void* storage) const { - char* shaderContextStorage = (char*)storage + sizeof(FilterShaderContext); - SkShader::Context* shaderContext = fShader->createContext(rec, shaderContextStorage); +SkShader::Context* SkColorFilterShader::onMakeContext(const ContextRec& rec, + SkArenaAlloc* alloc) const { + SkShader::Context* shaderContext = fShader->makeContext(rec, alloc); if (nullptr == shaderContext) { return nullptr; } - return new (storage) FilterShaderContext(*this, shaderContext, rec); + return alloc->make<FilterShaderContext>(*this, shaderContext, rec); } -size_t SkColorFilterShader::onContextSize(const ContextRec& rec) const { - return sizeof(FilterShaderContext) + fShader->contextSize(rec); -} SkColorFilterShader::FilterShaderContext::FilterShaderContext( const SkColorFilterShader& filterShader, @@ -74,10 +71,6 @@ SkColorFilterShader::FilterShaderContext::FilterShaderContext( , fShaderContext(shaderContext) {} -SkColorFilterShader::FilterShaderContext::~FilterShaderContext() { - fShaderContext->~Context(); -} - void SkColorFilterShader::FilterShaderContext::shadeSpan(int x, int y, SkPMColor result[], int count) { const SkColorFilterShader& filterShader = static_cast<const SkColorFilterShader&>(fShader); |