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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 Benchmark* bench = fBenches->factory()(NULL); | 496 Benchmark* bench = fBenches->factory()(NULL); |
497 fBenches = fBenches->next(); | 497 fBenches = fBenches->next(); |
498 fSourceType = "bench"; | 498 fSourceType = "bench"; |
499 fBenchType = "micro"; | 499 fBenchType = "micro"; |
500 return bench; | 500 return bench; |
501 } | 501 } |
502 | 502 |
503 while (fGMs) { | 503 while (fGMs) { |
504 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL)); | 504 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL)); |
505 fGMs = fGMs->next(); | 505 fGMs = fGMs->next(); |
506 if (gm->getFlags() & skiagm::GM::kAsBench_Flag) { | 506 if (gm->runAsBench()) { |
507 fSourceType = "gm"; | 507 fSourceType = "gm"; |
508 fBenchType = "micro"; | 508 fBenchType = "micro"; |
509 return SkNEW_ARGS(GMBench, (gm.detach())); | 509 return SkNEW_ARGS(GMBench, (gm.detach())); |
510 } | 510 } |
511 } | 511 } |
512 | 512 |
513 // First add all .skps as RecordingBenches. | 513 // First add all .skps as RecordingBenches. |
514 while (fCurrentRecording < fSKPs.count()) { | 514 while (fCurrentRecording < fSKPs.count()) { |
515 const SkString& path = fSKPs[fCurrentRecording++]; | 515 const SkString& path = fSKPs[fCurrentRecording++]; |
516 SkAutoTUnref<SkPicture> pic; | 516 SkAutoTUnref<SkPicture> pic; |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 | 791 |
792 return 0; | 792 return 0; |
793 } | 793 } |
794 | 794 |
795 #if !defined SK_BUILD_FOR_IOS | 795 #if !defined SK_BUILD_FOR_IOS |
796 int main(int argc, char** argv) { | 796 int main(int argc, char** argv) { |
797 SkCommandLineFlags::Parse(argc, argv); | 797 SkCommandLineFlags::Parse(argc, argv); |
798 return nanobench_main(); | 798 return nanobench_main(); |
799 } | 799 } |
800 #endif | 800 #endif |
OLD | NEW |