| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "PathOpsExtendedTest.h" | 8 #include "PathOpsExtendedTest.h" |
| 9 #include "PathOpsThreadedCommon.h" | 9 #include "PathOpsThreadedCommon.h" |
| 10 #include "SkTaskGroup.h" | 10 #include "SkTaskGroup.h" |
| 11 | 11 |
| 12 PathOpsThreadedTestRunner::~PathOpsThreadedTestRunner() { | 12 PathOpsThreadedTestRunner::~PathOpsThreadedTestRunner() { |
| 13 for (int index = 0; index < fRunnables.count(); index++) { | 13 for (int index = 0; index < fRunnables.count(); index++) { |
| 14 SkDELETE(fRunnables[index]); | 14 SkDELETE(fRunnables[index]); |
| 15 } | 15 } |
| 16 } | 16 } |
| 17 | 17 |
| 18 void PathOpsThreadedTestRunner::render() { | 18 void PathOpsThreadedTestRunner::render() { |
| 19 SkTaskGroup tg; | 19 sk_parallel_for(fRunnables.count(), [&](int i) { |
| 20 for (int index = 0; index < fRunnables.count(); ++ index) { | 20 fRunnables[i]->run(); |
| 21 tg.add(fRunnables[index]); | 21 }); |
| 22 } | |
| 23 } | 22 } |
| OLD | NEW |