Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: bench/benchmain.cpp

Issue 178473006: DM: also run benches once. (Closed) Base URL: https://skia.googlesource.com/skia.git@dm
Patch Set: add note Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « bench/SkGMBench.cpp ('k') | dm/DM.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « bench/SkGMBench.cpp ('k') | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698