Index: src/core/SkBlitter.cpp |
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp |
index b81432533b06966fa27ec83ebf3ed9a254b64cb9..35a213b8b74b30fc1fd0ee953f6bc3c27142212b 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>(); |
} |