OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "CrashHandler.h" | 8 #include "CrashHandler.h" |
9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 // CPU tests run on any thread. GPU tests depend on --gpu_threading. | 1086 // CPU tests run on any thread. GPU tests depend on --gpu_threading. |
1087 SkTArray<Task> enclaves[kNumEnclaves]; | 1087 SkTArray<Task> enclaves[kNumEnclaves]; |
1088 for (int j = 0; j < gSinks.count(); j++) { | 1088 for (int j = 0; j < gSinks.count(); j++) { |
1089 SkTArray<Task>& tasks = enclaves[gSinks[j]->enclave()]; | 1089 SkTArray<Task>& tasks = enclaves[gSinks[j]->enclave()]; |
1090 for (int i = 0; i < gSrcs.count(); i++) { | 1090 for (int i = 0; i < gSrcs.count(); i++) { |
1091 tasks.push_back(Task(gSrcs[i], gSinks[j])); | 1091 tasks.push_back(Task(gSrcs[i], gSinks[j])); |
1092 } | 1092 } |
1093 } | 1093 } |
1094 | 1094 |
1095 SkTaskGroup tg; | 1095 SkTaskGroup tg; |
1096 tg.batch([](int i){ run_test(&gThreadedTests[i]); }, gThreadedTests.count())
; | 1096 tg.batch(gThreadedTests.count(), [](int i){ run_test(&gThreadedTests[i]); })
; |
1097 for (int i = 0; i < kNumEnclaves; i++) { | 1097 for (int i = 0; i < kNumEnclaves; i++) { |
1098 SkTArray<Task>* currentEnclave = &enclaves[i]; | 1098 SkTArray<Task>* currentEnclave = &enclaves[i]; |
1099 switch(i) { | 1099 switch(i) { |
1100 case kAnyThread_Enclave: | 1100 case kAnyThread_Enclave: |
1101 tg.batch([currentEnclave](int j) { Task::Run(&(*currentEnclave)[
j]); }, currentEnclave->count()); | 1101 tg.batch(currentEnclave->count(), |
| 1102 [currentEnclave](int j) { Task::Run(&(*currentEnclave)[
j]); }); |
1102 break; | 1103 break; |
1103 case kGPU_Enclave: | 1104 case kGPU_Enclave: |
1104 tg.add([currentEnclave](){ run_enclave_and_gpu_tests(currentEncl
ave); }); | 1105 tg.add([currentEnclave](){ run_enclave_and_gpu_tests(currentEncl
ave); }); |
1105 break; | 1106 break; |
1106 default: | 1107 default: |
1107 tg.add([currentEnclave](){ run_enclave(currentEnclave); }); | 1108 tg.add([currentEnclave](){ run_enclave(currentEnclave); }); |
1108 break; | 1109 break; |
1109 } | 1110 } |
1110 } | 1111 } |
1111 tg.wait(); | 1112 tg.wait(); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 Reporter* reporter, | 1224 Reporter* reporter, |
1224 GrContextFactory* fac
tory); | 1225 GrContextFactory* fac
tory); |
1225 } // namespace skiatest | 1226 } // namespace skiatest |
1226 | 1227 |
1227 #if !defined(SK_BUILD_FOR_IOS) | 1228 #if !defined(SK_BUILD_FOR_IOS) |
1228 int main(int argc, char** argv) { | 1229 int main(int argc, char** argv) { |
1229 SkCommandLineFlags::Parse(argc, argv); | 1230 SkCommandLineFlags::Parse(argc, argv); |
1230 return dm_main(); | 1231 return dm_main(); |
1231 } | 1232 } |
1232 #endif | 1233 #endif |
OLD | NEW |