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

Side by Side Diff: bench/SkBenchmark.h

Issue 321723002: Reland "Clean up Test's resourcePath code." (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ETCBitmapBench fix Created 6 years, 6 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/ETCBitmapBench.cpp ('k') | bench/SkBenchmark.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef SkBenchmark_DEFINED 8 #ifndef SkBenchmark_DEFINED
9 #define SkBenchmark_DEFINED 9 #define SkBenchmark_DEFINED
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 * uint32_t flags = paint.getFlags(); 100 * uint32_t flags = paint.getFlags();
101 * flags &= ~clearMask; 101 * flags &= ~clearMask;
102 * flags |= orMask; 102 * flags |= orMask;
103 * paint.setFlags(flags); 103 * paint.setFlags(flags);
104 */ 104 */
105 void setPaintMasks(uint32_t orMask, uint32_t clearMask) { 105 void setPaintMasks(uint32_t orMask, uint32_t clearMask) {
106 fOrMask = orMask; 106 fOrMask = orMask;
107 fClearMask = clearMask; 107 fClearMask = clearMask;
108 } 108 }
109 109
110 static void SetResourcePath(const char* resPath) { gResourcePath.set(resPath ); } 110 static void SetResourcePath(const char*);
111 111 static SkString GetResourcePath();
112 static SkString& GetResourcePath() { return gResourcePath; }
113 112
114 protected: 113 protected:
115 virtual void setupPaint(SkPaint* paint); 114 virtual void setupPaint(SkPaint* paint);
116 115
117 virtual const char* onGetName() = 0; 116 virtual const char* onGetName() = 0;
118 virtual void onPreDraw() {} 117 virtual void onPreDraw() {}
119 // Each bench should do its main work in a loop like this: 118 // Each bench should do its main work in a loop like this:
120 // for (int i = 0; i < loops; i++) { <work here> } 119 // for (int i = 0; i < loops; i++) { <work here> }
121 virtual void onDraw(const int loops, SkCanvas*) = 0; 120 virtual void onDraw(const int loops, SkCanvas*) = 0;
122 virtual void onPostDraw() {} 121 virtual void onPostDraw() {}
123 122
124 virtual SkIPoint onGetSize(); 123 virtual SkIPoint onGetSize();
125 124
126 private: 125 private:
127 int fForceAlpha; 126 int fForceAlpha;
128 bool fForceAA; 127 bool fForceAA;
129 bool fForceFilter; 128 bool fForceFilter;
130 SkTriState::State fDither; 129 SkTriState::State fDither;
131 uint32_t fOrMask, fClearMask; 130 uint32_t fOrMask, fClearMask;
132 static SkString gResourcePath; 131 static const char* gResourcePath;
133 132
134 typedef SkRefCnt INHERITED; 133 typedef SkRefCnt INHERITED;
135 }; 134 };
136 135
137 typedef SkTRegistry<SkBenchmark*(*)(void*)> BenchRegistry; 136 typedef SkTRegistry<SkBenchmark*(*)(void*)> BenchRegistry;
138 137
139 #endif 138 #endif
OLDNEW
« no previous file with comments | « bench/ETCBitmapBench.cpp ('k') | bench/SkBenchmark.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698