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

Unified Diff: src/core/SkCanvas.cpp

Issue 2488523003: Make SkSmallAllocator obey the RAII invariants and be expandable (Closed)
Patch Set: fix includes 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
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index cd4dcbc2a509349838e5957b76f4535f00083c0c..980a5e447b13c416add858516fef6113be115a94 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -495,9 +495,11 @@ public:
}
if (SkDrawLooper* looper = paint.getLooper()) {
- void* buffer = fLooperContextAllocator.reserveT<SkDrawLooper::Context>(
- looper->contextSize());
- fLooperContext = looper->createContext(canvas, buffer);
+ fLooperContext = fLooperContextAllocator.createWithIniterT<SkDrawLooper::Context>(
+ looper->contextSize(),
+ [&](void* buffer) {
+ return looper->createContext(canvas, buffer);
+ });
fIsSimple = false;
} else {
fLooperContext = nullptr;
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkDrawLooper.cpp » ('j') | src/core/SkSmallAllocator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698