Index: src/core/SkBlitter.cpp |
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp |
index 35a213b8b74b30fc1fd0ee953f6bc3c27142212b..b81432533b06966fa27ec83ebf3ed9a254b64cb9 100644 |
--- a/src/core/SkBlitter.cpp |
+++ b/src/core/SkBlitter.cpp |
@@ -896,15 +896,14 @@ |
size_t contextSize = shader->contextSize(rec); |
if (contextSize) { |
// Try to create the ShaderContext |
- shaderContext = allocator->createWithIniter( |
- contextSize, |
- [&rec, shader](void* storage) { |
- return shader->createContext(rec, storage); |
- }); |
+ void* storage = allocator->reserveT<SkShader::Context>(contextSize); |
+ shaderContext = shader->createContext(rec, storage); |
if (!shaderContext) { |
+ allocator->freeLast(); |
return allocator->createT<SkNullBlitter>(); |
} |
SkASSERT(shaderContext); |
+ SkASSERT((void*) shaderContext == storage); |
} else { |
return allocator->createT<SkNullBlitter>(); |
} |