| 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 "Benchmark.h" | 10 #include "Benchmark.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 const char* config = targets[j]->config.name; | 612 const char* config = targets[j]->config.name; |
| 613 | 613 |
| 614 const int loops = | 614 const int loops = |
| 615 #if SK_SUPPORT_GPU | 615 #if SK_SUPPORT_GPU |
| 616 Benchmark::kGPU_Backend == targets[j]->config.backend | 616 Benchmark::kGPU_Backend == targets[j]->config.backend |
| 617 ? gpu_bench(targets[j]->gl, bench.get(), canvas, samples.get()) | 617 ? gpu_bench(targets[j]->gl, bench.get(), canvas, samples.get()) |
| 618 : | 618 : |
| 619 #endif | 619 #endif |
| 620 cpu_bench( overhead, bench.get(), canvas, samples.get()); | 620 cpu_bench( overhead, bench.get(), canvas, samples.get()); |
| 621 | 621 |
| 622 if (canvas && !FLAGS_writePath.isEmpty() && NULL != FLAGS_writePath[
0]) { | 622 if (canvas && !FLAGS_writePath.isEmpty() && FLAGS_writePath[0]) { |
| 623 SkString pngFilename = SkOSPath::Join(FLAGS_writePath[0], config
); | 623 SkString pngFilename = SkOSPath::Join(FLAGS_writePath[0], config
); |
| 624 pngFilename = SkOSPath::Join(pngFilename.c_str(), bench->getName
()); | 624 pngFilename = SkOSPath::Join(pngFilename.c_str(), bench->getName
()); |
| 625 pngFilename.append(".png"); | 625 pngFilename.append(".png"); |
| 626 write_canvas_png(canvas, pngFilename); | 626 write_canvas_png(canvas, pngFilename); |
| 627 } | 627 } |
| 628 | 628 |
| 629 if (kFailedLoops == loops) { | 629 if (kFailedLoops == loops) { |
| 630 // Can't be timed. A warning note has already been printed. | 630 // Can't be timed. A warning note has already been printed. |
| 631 continue; | 631 continue; |
| 632 } | 632 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 | 690 |
| 691 return 0; | 691 return 0; |
| 692 } | 692 } |
| 693 | 693 |
| 694 #if !defined SK_BUILD_FOR_IOS | 694 #if !defined SK_BUILD_FOR_IOS |
| 695 int main(int argc, char** argv) { | 695 int main(int argc, char** argv) { |
| 696 SkCommandLineFlags::Parse(argc, argv); | 696 SkCommandLineFlags::Parse(argc, argv); |
| 697 return nanobench_main(); | 697 return nanobench_main(); |
| 698 } | 698 } |
| 699 #endif | 699 #endif |
| OLD | NEW |