Chromium Code Reviews| 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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1031 | 1031 |
| 1032 #if SK_SUPPORT_GPU | 1032 #if SK_SUPPORT_GPU |
| 1033 GrContextOptions grContextOpts; | 1033 GrContextOptions grContextOpts; |
| 1034 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; | 1034 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; |
| 1035 gGrFactory.reset(new GrContextFactory(grContextOpts)); | 1035 gGrFactory.reset(new GrContextFactory(grContextOpts)); |
| 1036 #endif | 1036 #endif |
| 1037 | 1037 |
| 1038 if (FLAGS_veryVerbose) { | 1038 if (FLAGS_veryVerbose) { |
| 1039 FLAGS_verbose = true; | 1039 FLAGS_verbose = true; |
| 1040 } | 1040 } |
| 1041 if (FLAGS_verbose) { | |
| 1042 FLAGS_pre_log = true; | |
|
mtklein
2016/01/25 19:44:35
Ditto
dogben
2016/01/25 20:18:00
Done.
| |
| 1043 } | |
| 1041 | 1044 |
| 1042 if (kAutoTuneLoops != FLAGS_loops) { | 1045 if (kAutoTuneLoops != FLAGS_loops) { |
| 1043 FLAGS_samples = 1; | 1046 FLAGS_samples = 1; |
| 1044 FLAGS_gpuFrameLag = 0; | 1047 FLAGS_gpuFrameLag = 0; |
| 1045 } | 1048 } |
| 1046 | 1049 |
| 1047 if (!FLAGS_writePath.isEmpty()) { | 1050 if (!FLAGS_writePath.isEmpty()) { |
| 1048 SkDebugf("Writing files to %s.\n", FLAGS_writePath[0]); | 1051 SkDebugf("Writing files to %s.\n", FLAGS_writePath[0]); |
| 1049 if (!sk_mkdir(FLAGS_writePath[0])) { | 1052 if (!sk_mkdir(FLAGS_writePath[0])) { |
| 1050 SkDebugf("Could not create %s. Files won't be written.\n", FLAGS_wri tePath[0]); | 1053 SkDebugf("Could not create %s. Files won't be written.\n", FLAGS_wri tePath[0]); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1117 for (int i = 0; i < configs.count(); ++i) { | 1120 for (int i = 0; i < configs.count(); ++i) { |
| 1118 Target* target = is_enabled(b, configs[i]); | 1121 Target* target = is_enabled(b, configs[i]); |
| 1119 if (!target) { | 1122 if (!target) { |
| 1120 continue; | 1123 continue; |
| 1121 } | 1124 } |
| 1122 | 1125 |
| 1123 // During HWUI output this canvas may be nullptr. | 1126 // During HWUI output this canvas may be nullptr. |
| 1124 SkCanvas* canvas = target->getCanvas(); | 1127 SkCanvas* canvas = target->getCanvas(); |
| 1125 const char* config = target->config.name; | 1128 const char* config = target->config.name; |
| 1126 | 1129 |
| 1130 if (FLAGS_pre_log) { | |
| 1131 SkDebugf("Running %s\t%s\n" | |
| 1132 , bench->getUniqueName() | |
| 1133 , config); | |
| 1134 } | |
| 1135 | |
| 1127 target->setup(); | 1136 target->setup(); |
| 1128 bench->perCanvasPreDraw(canvas); | 1137 bench->perCanvasPreDraw(canvas); |
| 1129 | 1138 |
| 1130 int maxFrameLag; | 1139 int maxFrameLag; |
| 1131 int loops = target->needsFrameTiming(&maxFrameLag) | 1140 int loops = target->needsFrameTiming(&maxFrameLag) |
| 1132 ? setup_gpu_bench(target, bench.get(), maxFrameLag) | 1141 ? setup_gpu_bench(target, bench.get(), maxFrameLag) |
| 1133 : setup_cpu_bench(overhead, target, bench.get()); | 1142 : setup_cpu_bench(overhead, target, bench.get()); |
| 1134 | 1143 |
| 1135 if (FLAGS_ms) { | 1144 if (FLAGS_ms) { |
| 1136 samples.reset(); | 1145 samples.reset(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1258 | 1267 |
| 1259 return 0; | 1268 return 0; |
| 1260 } | 1269 } |
| 1261 | 1270 |
| 1262 #if !defined SK_BUILD_FOR_IOS | 1271 #if !defined SK_BUILD_FOR_IOS |
| 1263 int main(int argc, char** argv) { | 1272 int main(int argc, char** argv) { |
| 1264 SkCommandLineFlags::Parse(argc, argv); | 1273 SkCommandLineFlags::Parse(argc, argv); |
| 1265 return nanobench_main(); | 1274 return nanobench_main(); |
| 1266 } | 1275 } |
| 1267 #endif | 1276 #endif |
| OLD | NEW |