| 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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 create_targets(&targets, bench.get(), configs); | 588 create_targets(&targets, bench.get(), configs); |
| 589 | 589 |
| 590 if (!targets.isEmpty()) { | 590 if (!targets.isEmpty()) { |
| 591 log->bench(bench->getName(), bench->getSize().fX, bench->getSize().f
Y); | 591 log->bench(bench->getName(), bench->getSize().fX, bench->getSize().f
Y); |
| 592 bench->preDraw(); | 592 bench->preDraw(); |
| 593 } | 593 } |
| 594 for (int j = 0; j < targets.count(); j++) { | 594 for (int j = 0; j < targets.count(); j++) { |
| 595 SkCanvas* canvas = targets[j]->surface.get() ? targets[j]->surface->
getCanvas() : NULL; | 595 SkCanvas* canvas = targets[j]->surface.get() ? targets[j]->surface->
getCanvas() : NULL; |
| 596 const char* config = targets[j]->config.name; | 596 const char* config = targets[j]->config.name; |
| 597 | 597 |
| 598 #ifdef SK_DEBUG | |
| 599 // skia:2797 Some SKPs SkASSERT in debug mode. Skip them for now. | |
| 600 if (0 == strcmp("565", config) && SkStrContains(bench->getName(), ".
skp")) { | |
| 601 SkDebugf("Skipping 565 %s. See skia:2797\n", bench->getName()); | |
| 602 continue; | |
| 603 } | |
| 604 #endif | |
| 605 | |
| 606 const int loops = | 598 const int loops = |
| 607 #if SK_SUPPORT_GPU | 599 #if SK_SUPPORT_GPU |
| 608 Benchmark::kGPU_Backend == targets[j]->config.backend | 600 Benchmark::kGPU_Backend == targets[j]->config.backend |
| 609 ? gpu_bench(targets[j]->gl, bench.get(), canvas, samples.get()) | 601 ? gpu_bench(targets[j]->gl, bench.get(), canvas, samples.get()) |
| 610 : | 602 : |
| 611 #endif | 603 #endif |
| 612 cpu_bench( overhead, bench.get(), canvas, samples.get()); | 604 cpu_bench( overhead, bench.get(), canvas, samples.get()); |
| 613 | 605 |
| 614 if (canvas && !FLAGS_writePath.isEmpty() && NULL != FLAGS_writePath[
0]) { | 606 if (canvas && !FLAGS_writePath.isEmpty() && NULL != FLAGS_writePath[
0]) { |
| 615 SkString pngFilename = SkOSPath::Join(FLAGS_writePath[0], config
); | 607 SkString pngFilename = SkOSPath::Join(FLAGS_writePath[0], config
); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 | 674 |
| 683 return 0; | 675 return 0; |
| 684 } | 676 } |
| 685 | 677 |
| 686 #if !defined SK_BUILD_FOR_IOS | 678 #if !defined SK_BUILD_FOR_IOS |
| 687 int main(int argc, char** argv) { | 679 int main(int argc, char** argv) { |
| 688 SkCommandLineFlags::Parse(argc, argv); | 680 SkCommandLineFlags::Parse(argc, argv); |
| 689 return nanobench_main(); | 681 return nanobench_main(); |
| 690 } | 682 } |
| 691 #endif | 683 #endif |
| OLD | NEW |