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

Unified Diff: tests/PathOpsSkpClipTest.cpp

Issue 1184373003: Add sk_parallel_for() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix Created 5 years, 6 months 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 | « tests/PathOpsExtendedTest.cpp ('k') | tests/PathOpsThreadedCommon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsSkpClipTest.cpp
diff --git a/tests/PathOpsSkpClipTest.cpp b/tests/PathOpsSkpClipTest.cpp
index 1f69ff05e1832563be36ac69ca507d653c98e3b5..7ea3184442286c1c2d158662ad1e6a94cc068b63 100755
--- a/tests/PathOpsSkpClipTest.cpp
+++ b/tests/PathOpsSkpClipTest.cpp
@@ -303,10 +303,11 @@ TestRunner::~TestRunner() {
}
void TestRunner::render() {
- SkTaskGroup tg;
- for (int index = 0; index < fRunnables.count(); ++ index) {
- tg.add(fRunnables[index]);
- }
+ // TODO: this doesn't really need to use SkRunnables any more.
+ // We can just write the code to run in the for-loop directly.
+ sk_parallel_for(fRunnables.count(), [&](int i) {
+ fRunnables[i]->run();
+ });
}
////////////////////////////////////////////////
« no previous file with comments | « tests/PathOpsExtendedTest.cpp ('k') | tests/PathOpsThreadedCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698