OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |