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

Side by Side Diff: bench/nanobench.cpp

Issue 1681583002: Support --dryRun in nanobench to get a list of benchmarks. (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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 <ctype.h> 8 #include <ctype.h>
9 9
10 #include "nanobench.h" 10 #include "nanobench.h"
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 for (int i = 0; i < configs.count(); ++i) { 1075 for (int i = 0; i < configs.count(); ++i) {
1076 Target* target = is_enabled(b, configs[i]); 1076 Target* target = is_enabled(b, configs[i]);
1077 if (!target) { 1077 if (!target) {
1078 continue; 1078 continue;
1079 } 1079 }
1080 1080
1081 // During HWUI output this canvas may be nullptr. 1081 // During HWUI output this canvas may be nullptr.
1082 SkCanvas* canvas = target->getCanvas(); 1082 SkCanvas* canvas = target->getCanvas();
1083 const char* config = target->config.name.c_str(); 1083 const char* config = target->config.name.c_str();
1084 1084
1085 if (FLAGS_pre_log) { 1085 if (FLAGS_pre_log || FLAGS_dryRun) {
1086 SkDebugf("Running %s\t%s\n" 1086 SkDebugf("Running %s\t%s\n"
1087 , bench->getUniqueName() 1087 , bench->getUniqueName()
1088 , config); 1088 , config);
1089 if (FLAGS_dryRun) {
1090 continue;
1091 }
1089 } 1092 }
1090 1093
1091 target->setup(); 1094 target->setup();
1092 bench->perCanvasPreDraw(canvas); 1095 bench->perCanvasPreDraw(canvas);
1093 1096
1094 int maxFrameLag; 1097 int maxFrameLag;
1095 int loops = target->needsFrameTiming(&maxFrameLag) 1098 int loops = target->needsFrameTiming(&maxFrameLag)
1096 ? setup_gpu_bench(target, bench.get(), maxFrameLag) 1099 ? setup_gpu_bench(target, bench.get(), maxFrameLag)
1097 : setup_cpu_bench(overhead, target, bench.get()); 1100 : setup_cpu_bench(overhead, target, bench.get());
1098 1101
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 1225
1223 return 0; 1226 return 0;
1224 } 1227 }
1225 1228
1226 #if !defined SK_BUILD_FOR_IOS 1229 #if !defined SK_BUILD_FOR_IOS
1227 int main(int argc, char** argv) { 1230 int main(int argc, char** argv) {
1228 SkCommandLineFlags::Parse(argc, argv); 1231 SkCommandLineFlags::Parse(argc, argv);
1229 return nanobench_main(); 1232 return nanobench_main();
1230 } 1233 }
1231 #endif 1234 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698