| Index: tests/WArrayTest.cpp
|
| diff --git a/tests/WArrayTest.cpp b/tests/WArrayTest.cpp
|
| index 40128fa2b4dd47c1e62c1a5dc5f0d8ce606928bf..82a25e69c5a399dea57f99363a342966637c6a25 100644
|
| --- a/tests/WArrayTest.cpp
|
| +++ b/tests/WArrayTest.cpp
|
| @@ -151,18 +151,17 @@ class TestWData {
|
| const int fSubsetLen;
|
| const char* fExpected;
|
|
|
| - static bool getAdvance(void* tc, int gId, int16_t* advance) {
|
| - TestWData* testCase = (TestWData*)tc;
|
| - if (gId >= 0 && gId < testCase->fAdvancesLen) {
|
| - *advance = testCase->fAdvances[gId];
|
| - return true;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| void runTest(skiatest::Reporter* reporter) {
|
| SkAutoTDelete<SkAdvancedTypefaceMetrics::AdvanceMetric<int16_t> > result;
|
| - result.reset(getAdvanceData((void*)this, fAdvancesLen, fSubset, fSubsetLen, getAdvance));
|
| + std::function<bool(int gId, int16_t* data)> getWidthAdvanceFn =
|
| + [this](int gId, int16_t* advance) {
|
| + if (gId >= 0 && gId < fAdvancesLen) {
|
| + *advance = fAdvances[gId];
|
| + return true;
|
| + }
|
| + return false;
|
| + };
|
| + result.reset(getAdvanceData(fAdvancesLen, fSubset, fSubsetLen, getWidthAdvanceFn));
|
|
|
| SkString stringResult = stringify_advance_data(result);
|
| if (!stringResult.equals(fExpected)) {
|
|
|