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

Side by Side Diff: bench/SkBenchmark.h

Issue 346453002: Refactor how we handle resources path in Tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix rebase conflict 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 * uint32_t flags = paint.getFlags(); 95 * uint32_t flags = paint.getFlags();
96 * flags &= ~clearMask; 96 * flags &= ~clearMask;
97 * flags |= orMask; 97 * flags |= orMask;
98 * paint.setFlags(flags); 98 * paint.setFlags(flags);
99 */ 99 */
100 void setPaintMasks(uint32_t orMask, uint32_t clearMask) { 100 void setPaintMasks(uint32_t orMask, uint32_t clearMask) {
101 fOrMask = orMask; 101 fOrMask = orMask;
102 fClearMask = clearMask; 102 fClearMask = clearMask;
103 } 103 }
104 104
105 static void SetResourcePath(const char*);
106 static SkString GetResourcePath();
107
108 protected: 105 protected:
109 virtual void setupPaint(SkPaint* paint); 106 virtual void setupPaint(SkPaint* paint);
110 107
111 virtual const char* onGetName() = 0; 108 virtual const char* onGetName() = 0;
112 virtual void onPreDraw() {} 109 virtual void onPreDraw() {}
113 // Each bench should do its main work in a loop like this: 110 // Each bench should do its main work in a loop like this:
114 // for (int i = 0; i < loops; i++) { <work here> } 111 // for (int i = 0; i < loops; i++) { <work here> }
115 virtual void onDraw(const int loops, SkCanvas*) = 0; 112 virtual void onDraw(const int loops, SkCanvas*) = 0;
116 113
117 virtual SkIPoint onGetSize(); 114 virtual SkIPoint onGetSize();
118 115
119 private: 116 private:
120 int fForceAlpha; 117 int fForceAlpha;
121 bool fForceAA; 118 bool fForceAA;
122 bool fForceFilter; 119 bool fForceFilter;
123 SkTriState::State fDither; 120 SkTriState::State fDither;
124 uint32_t fOrMask, fClearMask; 121 uint32_t fOrMask, fClearMask;
125 static const char* gResourcePath;
126 122
127 typedef SkRefCnt INHERITED; 123 typedef SkRefCnt INHERITED;
128 }; 124 };
129 125
130 typedef SkTRegistry<SkBenchmark*(*)(void*)> BenchRegistry; 126 typedef SkTRegistry<SkBenchmark*(*)(void*)> BenchRegistry;
131 127
132 #endif 128 #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