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

Side by Side Diff: dm/DM.cpp

Issue 1681553003: Optionally run RAW images serially (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 576 }
577 } 577 }
578 578
579 SkTArray<SkString> images; 579 SkTArray<SkString> images;
580 if (!CollectImages(&images)) { 580 if (!CollectImages(&images)) {
581 return false; 581 return false;
582 } 582 }
583 583
584 for (auto image : images) { 584 for (auto image : images) {
585 push_codec_srcs(image); 585 push_codec_srcs(image);
586 const char* ext = ""; 586 if (brd_supported(SkStringExtension(image))) {
587 int index = image.findLastOf('.');
588 if (index >= 0 && (size_t) ++index < image.size()) {
589 ext = &image.c_str()[index];
590 }
591 if (brd_supported(ext)) {
592 push_brd_srcs(image); 587 push_brd_srcs(image);
593 } 588 }
594 } 589 }
595 590
596 return true; 591 return true;
597 } 592 }
598 593
599 static void push_sink(const SkCommandLineConfig& config, Sink* s) { 594 static void push_sink(const SkCommandLineConfig& config, Sink* s) {
600 SkAutoTDelete<Sink> sink(s); 595 SkAutoTDelete<Sink> sink(s);
601 596
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 SkDebugf("%d srcs * %d sinks + %d tests == %d tasks\n", 1147 SkDebugf("%d srcs * %d sinks + %d tests == %d tasks\n",
1153 gSrcs.count(), gSinks.count(), gThreadedTests.count() + gGPUTests.c ount(), gPending); 1148 gSrcs.count(), gSinks.count(), gThreadedTests.count() + gGPUTests.c ount(), gPending);
1154 1149
1155 // We try to exploit as much parallelism as is safe. Most Src/Sink pairs ru n on any thread, 1150 // We try to exploit as much parallelism as is safe. Most Src/Sink pairs ru n on any thread,
1156 // but Sinks that identify as part of a particular enclave run serially on a single thread. 1151 // but Sinks that identify as part of a particular enclave run serially on a single thread.
1157 // CPU tests run on any thread. GPU tests depend on --gpu_threading. 1152 // CPU tests run on any thread. GPU tests depend on --gpu_threading.
1158 SkTArray<Task> enclaves[kNumEnclaves]; 1153 SkTArray<Task> enclaves[kNumEnclaves];
1159 for (int j = 0; j < gSinks.count(); j++) { 1154 for (int j = 0; j < gSinks.count(); j++) {
1160 SkTArray<Task>& tasks = enclaves[gSinks[j]->enclave()]; 1155 SkTArray<Task>& tasks = enclaves[gSinks[j]->enclave()];
1161 for (int i = 0; i < gSrcs.count(); i++) { 1156 for (int i = 0; i < gSrcs.count(); i++) {
1162 tasks.push_back(Task(gSrcs[i], gSinks[j])); 1157 const int srcEnclave = gSrcs[i]->enclave();
1158 if (srcEnclave == kAnyThread_Enclave) {
1159 // Use the enclave of the Sink.
1160 tasks.push_back(Task(gSrcs[i], gSinks[j]));
mtklein 2016/02/08 21:26:54 This reads weirdly asymmetric now. Let's really r
1161 } else {
1162 // Use the enclave of the Src.
1163 enclaves[srcEnclave].push_back(Task(gSrcs[i], gSinks[j]));
1164 }
1163 } 1165 }
1164 } 1166 }
1165 1167
1166 SkTaskGroup tg; 1168 SkTaskGroup tg;
1167 tg.batch(gThreadedTests.count(), [](int i){ run_test(&gThreadedTests[i]); }) ; 1169 tg.batch(gThreadedTests.count(), [](int i){ run_test(&gThreadedTests[i]); }) ;
1168 for (int i = 0; i < kNumEnclaves; i++) { 1170 for (int i = 0; i < kNumEnclaves; i++) {
1169 SkTArray<Task>* currentEnclave = &enclaves[i]; 1171 SkTArray<Task>* currentEnclave = &enclaves[i];
1170 switch(i) { 1172 switch(i) {
msarett 2016/02/08 19:35:37 Do we need to handle kRAW_Enclave here? Is it han
scroggo 2016/02/08 20:08:12 Yes, it is handled by the default, so no need to c
1171 case kAnyThread_Enclave: 1173 case kAnyThread_Enclave:
1172 tg.batch(currentEnclave->count(), 1174 tg.batch(currentEnclave->count(),
1173 [currentEnclave](int j) { Task::Run(&(*currentEnclave)[ j]); }); 1175 [currentEnclave](int j) { Task::Run(&(*currentEnclave)[ j]); });
1174 break; 1176 break;
1175 case kGPU_Enclave: 1177 case kGPU_Enclave:
1176 tg.add([currentEnclave](){ run_enclave_and_gpu_tests(currentEncl ave); }); 1178 tg.add([currentEnclave](){ run_enclave_and_gpu_tests(currentEncl ave); });
1177 break; 1179 break;
1178 default: 1180 default:
1179 tg.add([currentEnclave](){ run_enclave(currentEnclave); }); 1181 tg.add([currentEnclave](){ run_enclave(currentEnclave); });
1180 break; 1182 break;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 Reporter* reporter, 1302 Reporter* reporter,
1301 GrContextFactory* fac tory); 1303 GrContextFactory* fac tory);
1302 } // namespace skiatest 1304 } // namespace skiatest
1303 1305
1304 #if !defined(SK_BUILD_FOR_IOS) 1306 #if !defined(SK_BUILD_FOR_IOS)
1305 int main(int argc, char** argv) { 1307 int main(int argc, char** argv) {
1306 SkCommandLineFlags::Parse(argc, argv); 1308 SkCommandLineFlags::Parse(argc, argv);
1307 return dm_main(); 1309 return dm_main();
1308 } 1310 }
1309 #endif 1311 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698