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