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 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 } | 1175 } |
1176 | 1176 |
1177 // During HWUI output this canvas may be nullptr. | 1177 // During HWUI output this canvas may be nullptr. |
1178 SkCanvas* canvas = target->getCanvas(); | 1178 SkCanvas* canvas = target->getCanvas(); |
1179 const char* config = target->config.name; | 1179 const char* config = target->config.name; |
1180 | 1180 |
1181 target->setup(); | 1181 target->setup(); |
1182 bench->perCanvasPreDraw(canvas); | 1182 bench->perCanvasPreDraw(canvas); |
1183 | 1183 |
1184 int maxFrameLag; | 1184 int maxFrameLag; |
1185 const int loops = target->needsFrameTiming(&maxFrameLag) | 1185 int loops = target->needsFrameTiming(&maxFrameLag) |
1186 ? setup_gpu_bench(target, bench.get(), maxFrameLag) | 1186 ? setup_gpu_bench(target, bench.get(), maxFrameLag) |
1187 : setup_cpu_bench(overhead, target, bench.get()); | 1187 : setup_cpu_bench(overhead, target, bench.get()); |
1188 | 1188 |
1189 if (kTimedSampling != FLAGS_samples) { | 1189 if (kTimedSampling != FLAGS_samples) { |
1190 samples.reset(FLAGS_samples); | 1190 samples.reset(FLAGS_samples); |
1191 for (int s = 0; s < FLAGS_samples; s++) { | 1191 for (int s = 0; s < FLAGS_samples; s++) { |
1192 samples[s] = time(loops, bench, target) / loops; | 1192 samples[s] = time(loops, bench, target) / loops; |
1193 } | 1193 } |
1194 } else if (samplingTimeMs) { | 1194 } else if (samplingTimeMs) { |
1195 samples.reset(); | 1195 samples.reset(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 | 1292 |
1293 return 0; | 1293 return 0; |
1294 } | 1294 } |
1295 | 1295 |
1296 #if !defined SK_BUILD_FOR_IOS | 1296 #if !defined SK_BUILD_FOR_IOS |
1297 int main(int argc, char** argv) { | 1297 int main(int argc, char** argv) { |
1298 SkCommandLineFlags::Parse(argc, argv); | 1298 SkCommandLineFlags::Parse(argc, argv); |
1299 return nanobench_main(); | 1299 return nanobench_main(); |
1300 } | 1300 } |
1301 #endif | 1301 #endif |
OLD | NEW |