OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "BenchTimer.h" | 8 #include "BenchTimer.h" |
9 #include "ResultsWriter.h" | 9 #include "ResultsWriter.h" |
10 #include "SkBenchLogger.h" | 10 #include "SkBenchLogger.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 /////////////////////////////////////////////////////////////////////////////// | 51 /////////////////////////////////////////////////////////////////////////////// |
52 | 52 |
53 class Iter { | 53 class Iter { |
54 public: | 54 public: |
55 Iter() : fBenches(BenchRegistry::Head()), fGMs(skiagm::GMRegistry::Head()) {
} | 55 Iter() : fBenches(BenchRegistry::Head()), fGMs(skiagm::GMRegistry::Head()) {
} |
56 | 56 |
57 SkBenchmark* next() { | 57 SkBenchmark* next() { |
58 if (fBenches) { | 58 if (fBenches) { |
59 BenchRegistry::Factory f = fBenches->factory(); | 59 BenchRegistry::Factory f = fBenches->factory(); |
60 fBenches = fBenches->next(); | 60 fBenches = fBenches->next(); |
61 return (*f)(); | 61 return (*f)(NULL); |
62 } | 62 } |
63 | 63 |
64 while (fGMs) { | 64 while (fGMs) { |
65 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL)); | 65 SkAutoTDelete<skiagm::GM> gm(fGMs->factory()(NULL)); |
66 fGMs = fGMs->next(); | 66 fGMs = fGMs->next(); |
67 if (gm->getFlags() & skiagm::GM::kAsBench_Flag) { | 67 if (gm->getFlags() & skiagm::GM::kAsBench_Flag) { |
68 return SkNEW_ARGS(SkGMBench, (gm.detach())); | 68 return SkNEW_ARGS(SkGMBench, (gm.detach())); |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 gContextFactory.destroyContexts(); | 680 gContextFactory.destroyContexts(); |
681 #endif | 681 #endif |
682 return 0; | 682 return 0; |
683 } | 683 } |
684 | 684 |
685 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 685 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
686 int main(int argc, char * const argv[]) { | 686 int main(int argc, char * const argv[]) { |
687 return tool_main(argc, (char**) argv); | 687 return tool_main(argc, (char**) argv); |
688 } | 688 } |
689 #endif | 689 #endif |
OLD | NEW |