From aaa3056e46ed9004097dc784db94c3a97d070569 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Fri, 21 Jul 2017 11:53:23 -0400 Subject: switch away from std::function in public api Bug: skia: Change-Id: I181382dc1f9d8671b814134c1a787185745b90a8 Reviewed-on: https://skia-review.googlesource.com/25643 Reviewed-by: Ben Wagner Commit-Queue: Mike Reed --- tests/TextBlobTest.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/TextBlobTest.cpp b/tests/TextBlobTest.cpp index c00970fa23..d8d4865b29 100644 --- a/tests/TextBlobTest.cpp +++ b/tests/TextBlobTest.cpp @@ -434,23 +434,25 @@ DEF_TEST(TextBlob_serialize, reporter) { sk_sp blob0 = builder.make(); SkTDArray array; - sk_sp data = blob0->serialize([&array](SkTypeface* tf) { - if (array.find(tf) < 0) { - *array.append() = tf; + sk_sp data = blob0->serialize([](SkTypeface* tf, void* ctx) { + auto array = (SkTDArray*)ctx; + if (array->find(tf) < 0) { + *array->append() = tf; } - }); + }, &array); REPORTER_ASSERT(reporter, array.count() > 0); sk_sp blob1 = SkTextBlob::Deserialize(data->data(), data->size(), - [&array, reporter](uint32_t uniqueID) { - for (int i = 0; i < array.count(); ++i) { - if (array[i]->uniqueID() == uniqueID) { - return sk_ref_sp(array[i]); + [](uint32_t uniqueID, void* ctx) { + auto array = (SkTDArray*)ctx; + for (int i = 0; i < array->count(); ++i) { + if ((*array)[i]->uniqueID() == uniqueID) { + return sk_ref_sp((*array)[i]); } } - REPORTER_ASSERT(reporter, false); + SkASSERT(false); return sk_sp(nullptr); - }); + }, &array); sk_sp img0 = render(blob0.get()); sk_sp img1 = render(blob1.get()); -- cgit v1.2.3