Index: src/core/SkBlitter.cpp |
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp |
index 3643e667601d2b8a60c0ee4e4000d56f541a7a0c..8f5973c851a105d94589c1426544b45bff08fac1 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->createWithIniterT<SkShader::Context>( |
+ 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>(); |
} |