Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1186)

Unified Diff: src/core/SkBlitter.cpp

Issue 2494353002: Revert of Make SkSmallAllocator obey the RAII invariants and be expandable (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>();
}
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698