diff options
Diffstat (limited to 'src/core/SkBlitter.cpp')
-rw-r--r-- | src/core/SkBlitter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index b81432533b..35a213b8b7 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -896,14 +896,15 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device, size_t contextSize = shader->contextSize(rec); if (contextSize) { // Try to create the ShaderContext - void* storage = allocator->reserveT<SkShader::Context>(contextSize); - shaderContext = shader->createContext(rec, storage); + shaderContext = allocator->createWithIniter( + contextSize, + [&rec, shader](void* storage) { + return shader->createContext(rec, storage); + }); if (!shaderContext) { - allocator->freeLast(); return allocator->createT<SkNullBlitter>(); } SkASSERT(shaderContext); - SkASSERT((void*) shaderContext == storage); } else { return allocator->createT<SkNullBlitter>(); } |