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

Side by Side Diff: bench/benchmain.cpp

Issue 148283017: Make GMs aware of what tool they're being run in. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: w to this->getMode() 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | gm/convexpolyclip.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 public: 48 public:
49 GMBenchFactory(const skiagm::GMRegistry* gmreg) 49 GMBenchFactory(const skiagm::GMRegistry* gmreg)
50 : fGMFactory(gmreg->factory()) { 50 : fGMFactory(gmreg->factory()) {
51 fSelfRegistry = SkNEW_ARGS(BenchRegistry, (this)); 51 fSelfRegistry = SkNEW_ARGS(BenchRegistry, (this));
52 } 52 }
53 53
54 virtual ~GMBenchFactory() { SkDELETE(fSelfRegistry); } 54 virtual ~GMBenchFactory() { SkDELETE(fSelfRegistry); }
55 55
56 virtual SkBenchmark* operator()() const SK_OVERRIDE { 56 virtual SkBenchmark* operator()() const SK_OVERRIDE {
57 skiagm::GM* gm = fGMFactory(NULL); 57 skiagm::GM* gm = fGMFactory(NULL);
58 gm->setMode(skiagm::GM::kBench_Mode);
58 return SkNEW_ARGS(SkGMBench, (gm)); 59 return SkNEW_ARGS(SkGMBench, (gm));
59 } 60 }
60 61
61 private: 62 private:
62 skiagm::GMRegistry::Factory fGMFactory; 63 skiagm::GMRegistry::Factory fGMFactory;
63 BenchRegistry* fSelfRegistry; 64 BenchRegistry* fSelfRegistry;
64 }; 65 };
65 66
66 static void register_gm_benches() { 67 static void register_gm_benches() {
67 static bool gOnce; 68 static bool gOnce;
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 gContextFactory.destroyContexts(); 718 gContextFactory.destroyContexts();
718 #endif 719 #endif
719 return 0; 720 return 0;
720 } 721 }
721 722
722 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 723 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
723 int main(int argc, char * const argv[]) { 724 int main(int argc, char * const argv[]) {
724 return tool_main(argc, (char**) argv); 725 return tool_main(argc, (char**) argv);
725 } 726 }
726 #endif 727 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/convexpolyclip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698