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

Unified Diff: dm/DM.cpp

Issue 1519573003: Change SkTaskGroup to use std::function. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address comments Created 5 years 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 | « no previous file | src/core/SkTaskGroup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 4df4f5861b09b42372a70ff0ef81757b21c98a24..d5001039d772216d80ce6fa9d30e6bbf99e91848 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1108,17 +1108,18 @@ int dm_main() {
}
SkTaskGroup tg;
- tg.batch(run_test, gThreadedTests.begin(), gThreadedTests.count());
+ tg.batch([](int i){ run_test(&gThreadedTests[i]); }, gThreadedTests.count());
for (int i = 0; i < kNumEnclaves; i++) {
+ SkTArray<Task>* currentEnclave = &enclaves[i];
switch(i) {
case kAnyThread_Enclave:
- tg.batch(Task::Run, enclaves[i].begin(), enclaves[i].count());
+ tg.batch([currentEnclave](int j) { Task::Run(&(*currentEnclave)[j]); }, currentEnclave->count());
break;
case kGPU_Enclave:
- tg.add(run_enclave_and_gpu_tests, &enclaves[i]);
+ tg.add([currentEnclave](){ run_enclave_and_gpu_tests(currentEnclave); });
break;
default:
- tg.add(run_enclave, &enclaves[i]);
+ tg.add([currentEnclave](){ run_enclave(currentEnclave); });
break;
}
}
@@ -1174,7 +1175,6 @@ void call_test(TestWithGrContextAndGLContext test, skiatest::Reporter* reporter,
#endif
} // namespace
-
template<typename T>
void RunWithGPUTestContexts(T test, GPUTestContexts testContexts, Reporter* reporter,
GrContextFactory* factory) {
« no previous file with comments | « no previous file | src/core/SkTaskGroup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698