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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 bool drawPathMasksToCompressedTexturesSupport() const { | 210 bool drawPathMasksToCompressedTexturesSupport() const { |
211 return fDrawPathMasksToCompressedTextureSupport; | 211 return fDrawPathMasksToCompressedTextureSupport; |
212 } | 212 } |
213 | 213 |
214 size_t geometryBufferMapThreshold() const { | 214 size_t geometryBufferMapThreshold() const { |
215 SkASSERT(fGeometryBufferMapThreshold >= 0); | 215 SkASSERT(fGeometryBufferMapThreshold >= 0); |
216 return fGeometryBufferMapThreshold; | 216 return fGeometryBufferMapThreshold; |
217 } | 217 } |
218 | 218 |
| 219 bool supportsInstancedDraws() const { |
| 220 return fSupportsInstancedDraws; |
| 221 } |
| 222 |
219 protected: | 223 protected: |
220 /** Subclasses must call this at the end of their constructors in order to a
pply caps | 224 /** Subclasses must call this at the end of their constructors in order to a
pply caps |
221 overrides requested by the client. Note that overrides will only reduce
the caps never | 225 overrides requested by the client. Note that overrides will only reduce
the caps never |
222 expand them. */ | 226 expand them. */ |
223 void applyOptionsOverrides(const GrContextOptions& options); | 227 void applyOptionsOverrides(const GrContextOptions& options); |
224 | 228 |
225 SkAutoTUnref<GrShaderCaps> fShaderCaps; | 229 SkAutoTUnref<GrShaderCaps> fShaderCaps; |
226 | 230 |
227 bool fNPOTTextureTileSupport : 1; | 231 bool fNPOTTextureTileSupport : 1; |
228 bool fMipMapSupport : 1; | 232 bool fMipMapSupport : 1; |
229 bool fTwoSidedStencilSupport : 1; | 233 bool fTwoSidedStencilSupport : 1; |
230 bool fStencilWrapOpsSupport : 1; | 234 bool fStencilWrapOpsSupport : 1; |
231 bool fDiscardRenderTargetSupport : 1; | 235 bool fDiscardRenderTargetSupport : 1; |
232 bool fReuseScratchTextures : 1; | 236 bool fReuseScratchTextures : 1; |
233 bool fReuseScratchBuffers : 1; | 237 bool fReuseScratchBuffers : 1; |
234 bool fGpuTracingSupport : 1; | 238 bool fGpuTracingSupport : 1; |
235 bool fCompressedTexSubImageSupport : 1; | 239 bool fCompressedTexSubImageSupport : 1; |
236 bool fOversizedStencilSupport : 1; | 240 bool fOversizedStencilSupport : 1; |
237 bool fTextureBarrierSupport : 1; | 241 bool fTextureBarrierSupport : 1; |
| 242 bool fSupportsInstancedDraws : 1; |
238 | 243 |
239 // Driver workaround | 244 // Driver workaround |
240 bool fUseDrawInsteadOfClear : 1; | 245 bool fUseDrawInsteadOfClear : 1; |
241 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; | 246 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; |
242 | 247 |
243 BlendEquationSupport fBlendEquationSupport; | 248 BlendEquationSupport fBlendEquationSupport; |
244 uint32_t fAdvBlendEqBlacklist; | 249 uint32_t fAdvBlendEqBlacklist; |
245 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); | 250 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); |
246 | 251 |
247 uint32_t fMapBufferFlags; | 252 uint32_t fMapBufferFlags; |
248 int fGeometryBufferMapThreshold; | 253 int fGeometryBufferMapThreshold; |
249 | 254 |
250 int fMaxRenderTargetSize; | 255 int fMaxRenderTargetSize; |
251 int fMaxTextureSize; | 256 int fMaxTextureSize; |
252 int fMinTextureSize; | 257 int fMinTextureSize; |
253 int fMaxSampleCount; | 258 int fMaxSampleCount; |
254 | 259 |
255 // The first entry for each config is without msaa and the second is with. | 260 // The first entry for each config is without msaa and the second is with. |
256 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; | 261 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
257 bool fConfigTextureSupport[kGrPixelConfigCnt]; | 262 bool fConfigTextureSupport[kGrPixelConfigCnt]; |
258 | 263 |
259 private: | 264 private: |
260 bool fSupressPrints : 1; | 265 bool fSupressPrints : 1; |
261 bool fDrawPathMasksToCompressedTextureSupport : 1; | 266 bool fDrawPathMasksToCompressedTextureSupport : 1; |
262 | 267 |
263 typedef SkRefCnt INHERITED; | 268 typedef SkRefCnt INHERITED; |
264 }; | 269 }; |
265 | 270 |
266 #endif | 271 #endif |
OLD | NEW |