OLD | NEW |
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 Loading... |
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 |
OLD | NEW |