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

Unified Diff: src/core/SkCanvas.cpp

Issue 2488523003: Make SkSmallAllocator obey the RAII invariants and be expandable (Closed)
Patch Set: Strip pointer to make correct type 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 | « src/core/SkBlitter.cpp ('k') | src/core/SkDrawLooper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index a8d73a982a5f591f116b3189d78fa64a5cb60860..eddf106ae4a405c1a18c1456109062efd9ed0d74 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -496,9 +496,11 @@ public:
}
if (SkDrawLooper* looper = paint.getLooper()) {
- void* buffer = fLooperContextAllocator.reserveT<SkDrawLooper::Context>(
- looper->contextSize());
- fLooperContext = looper->createContext(canvas, buffer);
+ fLooperContext = fLooperContextAllocator.createWithIniter(
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698