Index: tests/LayerDrawLooperTest.cpp |
diff --git a/tests/LayerDrawLooperTest.cpp b/tests/LayerDrawLooperTest.cpp |
index 87add3156f56f2224dc80ab0545552c6e5c4c296..4897fd28844fad377744fd95af3391e72d76ab7c 100644 |
--- a/tests/LayerDrawLooperTest.cpp |
+++ b/tests/LayerDrawLooperTest.cpp |
@@ -60,11 +60,8 @@ |
SkPaint paint; |
auto looper(looperBuilder.detach()); |
SkSmallAllocator<1, 32> allocator; |
- SkDrawLooper::Context* context = allocator.createWithIniterT<SkDrawLooper::Context>( |
- looper->contextSize(), |
- [&](void* buffer) { |
- return looper->createContext(&canvas, buffer); |
- }); |
+ void* buffer = allocator.reserveT<SkDrawLooper::Context>(looper->contextSize()); |
+ SkDrawLooper::Context* context = looper->createContext(&canvas, buffer); |
// The back layer should come first. |
REPORTER_ASSERT(reporter, context->next(&canvas, &paint)); |
@@ -103,11 +100,8 @@ |
SkPaint paint; |
auto looper(looperBuilder.detach()); |
SkSmallAllocator<1, 32> allocator; |
- SkDrawLooper::Context* context = allocator.createWithIniterT<SkDrawLooper::Context>( |
- looper->contextSize(), |
- [&](void* buffer) { |
- return looper->createContext(&canvas, buffer); |
- }); |
+ void* buffer = allocator.reserveT<SkDrawLooper::Context>(looper->contextSize()); |
+ SkDrawLooper::Context* context = looper->createContext(&canvas, buffer); |
// The back layer should come first. |
REPORTER_ASSERT(reporter, context->next(&canvas, &paint)); |
@@ -146,11 +140,8 @@ |
SkPaint paint; |
sk_sp<SkDrawLooper> looper(looperBuilder.detach()); |
SkSmallAllocator<1, 32> allocator; |
- SkDrawLooper::Context* context = allocator.createWithIniterT<SkDrawLooper::Context>( |
- looper->contextSize(), |
- [&](void* buffer) { |
- return looper->createContext(&canvas, buffer); |
- }); |
+ void* buffer = allocator.reserveT<SkDrawLooper::Context>(looper->contextSize()); |
+ SkDrawLooper::Context* context = looper->createContext(&canvas, buffer); |
// The back layer should come first. |
REPORTER_ASSERT(reporter, context->next(&canvas, &paint)); |