diff options
author | 2017-02-07 17:28:15 +0000 | |
---|---|---|
committer | 2017-02-07 17:28:21 +0000 | |
commit | dd8b72ae7319598cfc1024901e860c52f06e6ae1 (patch) | |
tree | b6e94e11c082c691512f8989ae55794fa2e6b756 /src/core/SkColorFilterShader.cpp | |
parent | 1f2fff2544a9dc6a0f169a017d374eca9f04c6b5 (diff) |
Revert "Use SkArenaAlloc instead of SkSmallAllocator in the SkAutoBlitterChoose code."
This reverts commit 2b57b7f7a7fc97db57f190b5a8ebcf68e177ee2d.
Reason for revert: Android compile failing
Original change's description:
> 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>
>
TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Id09c35377dddae0811d998b7d0c34c422325a5bc
Reviewed-on: https://skia-review.googlesource.com/8129
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core/SkColorFilterShader.cpp')
-rw-r--r-- | src/core/SkColorFilterShader.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/core/SkColorFilterShader.cpp b/src/core/SkColorFilterShader.cpp index 5e96b24b41..4090a18b45 100644 --- a/src/core/SkColorFilterShader.cpp +++ b/src/core/SkColorFilterShader.cpp @@ -5,7 +5,6 @@ * found in the LICENSE file. */ -#include "SkArenaAlloc.h" #include "SkColorFilterShader.h" #include "SkReadBuffer.h" #include "SkWriteBuffer.h" @@ -53,15 +52,19 @@ uint32_t SkColorFilterShader::FilterShaderContext::getFlags() const { return shaderF; } -SkShader::Context* SkColorFilterShader::onMakeContext(const ContextRec& rec, - SkArenaAlloc* alloc) const { - SkShader::Context* shaderContext = fShader->makeContext(rec, alloc); +SkShader::Context* SkColorFilterShader::onCreateContext(const ContextRec& rec, + void* storage) const { + char* shaderContextStorage = (char*)storage + sizeof(FilterShaderContext); + SkShader::Context* shaderContext = fShader->createContext(rec, shaderContextStorage); if (nullptr == shaderContext) { return nullptr; } - return alloc->make<FilterShaderContext>(*this, shaderContext, rec); + return new (storage) FilterShaderContext(*this, shaderContext, rec); } +size_t SkColorFilterShader::onContextSize(const ContextRec& rec) const { + return sizeof(FilterShaderContext) + fShader->contextSize(rec); +} SkColorFilterShader::FilterShaderContext::FilterShaderContext( const SkColorFilterShader& filterShader, @@ -71,6 +74,10 @@ 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); |