OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 GrCaps_DEFINED | 8 #ifndef GrCaps_DEFINED |
9 #define GrCaps_DEFINED | 9 #define GrCaps_DEFINED |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } | 188 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } |
189 int maxTextureSize() const { return fMaxTextureSize; } | 189 int maxTextureSize() const { return fMaxTextureSize; } |
190 /** This is the maximum tile size to use by GPU devices for rendering sw-bac
ked images/bitmaps. | 190 /** This is the maximum tile size to use by GPU devices for rendering sw-bac
ked images/bitmaps. |
191 It is usually the max texture size, unless we're overriding it for testi
ng. */ | 191 It is usually the max texture size, unless we're overriding it for testi
ng. */ |
192 int maxTileSize() const { SkASSERT(fMaxTileSize <= fMaxTextureSize); return
fMaxTileSize; } | 192 int maxTileSize() const { SkASSERT(fMaxTileSize <= fMaxTextureSize); return
fMaxTileSize; } |
193 | 193 |
194 // Will be 0 if MSAA is not supported | 194 // Will be 0 if MSAA is not supported |
195 int maxSampleCount() const { return fMaxSampleCount; } | 195 int maxSampleCount() const { return fMaxSampleCount; } |
196 | 196 |
197 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { | 197 virtual bool isConfigTexturable(GrPixelConfig config) const = 0; |
198 SkASSERT(kGrPixelConfigCnt > config); | 198 virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const =
0; |
199 return fConfigRenderSupport[config][withMSAA]; | |
200 } | |
201 | |
202 bool isConfigTexturable(GrPixelConfig config) const { | |
203 SkASSERT(kGrPixelConfigCnt > config); | |
204 return fConfigTextureSupport[config]; | |
205 } | |
206 | 199 |
207 bool suppressPrints() const { return fSuppressPrints; } | 200 bool suppressPrints() const { return fSuppressPrints; } |
208 | 201 |
209 bool immediateFlush() const { return fImmediateFlush; } | 202 bool immediateFlush() const { return fImmediateFlush; } |
210 | 203 |
211 bool drawPathMasksToCompressedTexturesSupport() const { | 204 bool drawPathMasksToCompressedTexturesSupport() const { |
212 return fDrawPathMasksToCompressedTextureSupport; | 205 return fDrawPathMasksToCompressedTextureSupport; |
213 } | 206 } |
214 | 207 |
215 size_t geometryBufferMapThreshold() const { | 208 size_t geometryBufferMapThreshold() const { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); | 256 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); |
264 | 257 |
265 uint32_t fMapBufferFlags; | 258 uint32_t fMapBufferFlags; |
266 int fGeometryBufferMapThreshold; | 259 int fGeometryBufferMapThreshold; |
267 | 260 |
268 int fMaxRenderTargetSize; | 261 int fMaxRenderTargetSize; |
269 int fMaxTextureSize; | 262 int fMaxTextureSize; |
270 int fMaxTileSize; | 263 int fMaxTileSize; |
271 int fMaxSampleCount; | 264 int fMaxSampleCount; |
272 | 265 |
273 // The first entry for each config is without msaa and the second is with. | |
274 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; | |
275 bool fConfigTextureSupport[kGrPixelConfigCnt]; | |
276 | |
277 private: | 266 private: |
278 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; | 267 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; |
279 | 268 |
280 bool fSuppressPrints : 1; | 269 bool fSuppressPrints : 1; |
281 bool fImmediateFlush: 1; | 270 bool fImmediateFlush: 1; |
282 bool fDrawPathMasksToCompressedTextureSupport : 1; | 271 bool fDrawPathMasksToCompressedTextureSupport : 1; |
283 | 272 |
284 typedef SkRefCnt INHERITED; | 273 typedef SkRefCnt INHERITED; |
285 }; | 274 }; |
286 | 275 |
287 #endif | 276 #endif |
OLD | NEW |