| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor
t of MIP Maps (e.g. | 115 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor
t of MIP Maps (e.g. |
| 116 only for POT textures) */ | 116 only for POT textures) */ |
| 117 bool mipMapSupport() const { return fMipMapSupport; } | 117 bool mipMapSupport() const { return fMipMapSupport; } |
| 118 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } | 118 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } |
| 119 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } | 119 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } |
| 120 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport
; } | 120 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport
; } |
| 121 bool gpuTracingSupport() const { return fGpuTracingSupport; } | 121 bool gpuTracingSupport() const { return fGpuTracingSupport; } |
| 122 bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSup
port; } | 122 bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSup
port; } |
| 123 bool oversizedStencilSupport() const { return fOversizedStencilSupport; } | 123 bool oversizedStencilSupport() const { return fOversizedStencilSupport; } |
| 124 bool textureBarrierSupport() const { return fTextureBarrierSupport; } | 124 bool textureBarrierSupport() const { return fTextureBarrierSupport; } |
| 125 bool mixedSamplesSupport() const { return fMixedSamplesSupport; } | 125 bool usesMixedSamples() const { return fUsesMixedSamples; } |
| 126 | 126 |
| 127 bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; } | 127 bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; } |
| 128 bool useDrawInsteadOfPartialRenderTargetWrite() const { | 128 bool useDrawInsteadOfPartialRenderTargetWrite() const { |
| 129 return fUseDrawInsteadOfPartialRenderTargetWrite; | 129 return fUseDrawInsteadOfPartialRenderTargetWrite; |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } | 132 bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * Indicates the capabilities of the fixed function blend unit. | 135 * Indicates the capabilities of the fixed function blend unit. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 bool reuseScratchTextures() const { return fReuseScratchTextures; } | 181 bool reuseScratchTextures() const { return fReuseScratchTextures; } |
| 182 bool reuseScratchBuffers() const { return fReuseScratchBuffers; } | 182 bool reuseScratchBuffers() const { return fReuseScratchBuffers; } |
| 183 | 183 |
| 184 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } | 184 int maxRenderTargetSize() const { return fMaxRenderTargetSize; } |
| 185 int maxTextureSize() const { return fMaxTextureSize; } | 185 int maxTextureSize() const { return fMaxTextureSize; } |
| 186 /** This is the maximum tile size to use by GPU devices for rendering sw-bac
ked images/bitmaps. | 186 /** This is the maximum tile size to use by GPU devices for rendering sw-bac
ked images/bitmaps. |
| 187 It is usually the max texture size, unless we're overriding it for testi
ng. */ | 187 It is usually the max texture size, unless we're overriding it for testi
ng. */ |
| 188 int maxTileSize() const { SkASSERT(fMaxTileSize <= fMaxTextureSize); return
fMaxTileSize; } | 188 int maxTileSize() const { SkASSERT(fMaxTileSize <= fMaxTextureSize); return
fMaxTileSize; } |
| 189 | 189 |
| 190 // Will be 0 if MSAA is not supported | 190 // Will be 0 if MSAA is not supported |
| 191 int maxSampleCount() const { return fMaxSampleCount; } | 191 int maxColorSampleCount() const { return fMaxColorSampleCount; } |
| 192 // Will be 0 if MSAA is not supported |
| 193 int maxStencilSampleCount() const { return fMaxStencilSampleCount; } |
| 194 // We require the sample count to be less than maxColorSampleCount and maxSt
encilSampleCount. |
| 195 // If we are using mixed samples, we only care about stencil. |
| 196 int maxSampleCount() const { |
| 197 if (this->usesMixedSamples()) { |
| 198 return this->maxStencilSampleCount(); |
| 199 } else { |
| 200 return SkTMin(this->maxColorSampleCount(), this->maxStencilSampleCou
nt()); |
| 201 } |
| 202 } |
| 203 |
| 192 | 204 |
| 193 virtual bool isConfigTexturable(GrPixelConfig config) const = 0; | 205 virtual bool isConfigTexturable(GrPixelConfig config) const = 0; |
| 194 virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const =
0; | 206 virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const =
0; |
| 195 | 207 |
| 196 bool suppressPrints() const { return fSuppressPrints; } | 208 bool suppressPrints() const { return fSuppressPrints; } |
| 197 | 209 |
| 198 bool immediateFlush() const { return fImmediateFlush; } | 210 bool immediateFlush() const { return fImmediateFlush; } |
| 199 | 211 |
| 200 bool drawPathMasksToCompressedTexturesSupport() const { | 212 bool drawPathMasksToCompressedTexturesSupport() const { |
| 201 return fDrawPathMasksToCompressedTextureSupport; | 213 return fDrawPathMasksToCompressedTextureSupport; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 228 bool fMipMapSupport : 1; | 240 bool fMipMapSupport : 1; |
| 229 bool fTwoSidedStencilSupport : 1; | 241 bool fTwoSidedStencilSupport : 1; |
| 230 bool fStencilWrapOpsSupport : 1; | 242 bool fStencilWrapOpsSupport : 1; |
| 231 bool fDiscardRenderTargetSupport : 1; | 243 bool fDiscardRenderTargetSupport : 1; |
| 232 bool fReuseScratchTextures : 1; | 244 bool fReuseScratchTextures : 1; |
| 233 bool fReuseScratchBuffers : 1; | 245 bool fReuseScratchBuffers : 1; |
| 234 bool fGpuTracingSupport : 1; | 246 bool fGpuTracingSupport : 1; |
| 235 bool fCompressedTexSubImageSupport : 1; | 247 bool fCompressedTexSubImageSupport : 1; |
| 236 bool fOversizedStencilSupport : 1; | 248 bool fOversizedStencilSupport : 1; |
| 237 bool fTextureBarrierSupport : 1; | 249 bool fTextureBarrierSupport : 1; |
| 238 bool fMixedSamplesSupport : 1; | 250 bool fUsesMixedSamples : 1; |
| 239 bool fSupportsInstancedDraws : 1; | 251 bool fSupportsInstancedDraws : 1; |
| 240 bool fFullClearIsFree : 1; | 252 bool fFullClearIsFree : 1; |
| 241 bool fMustClearUploadedBufferData : 1; | 253 bool fMustClearUploadedBufferData : 1; |
| 242 | 254 |
| 243 // Driver workaround | 255 // Driver workaround |
| 244 bool fUseDrawInsteadOfClear : 1; | 256 bool fUseDrawInsteadOfClear : 1; |
| 245 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; | 257 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; |
| 246 | 258 |
| 247 // ANGLE workaround | 259 // ANGLE workaround |
| 248 bool fPreferVRAMUseOverFlushes : 1; | 260 bool fPreferVRAMUseOverFlushes : 1; |
| 249 | 261 |
| 250 BlendEquationSupport fBlendEquationSupport; | 262 BlendEquationSupport fBlendEquationSupport; |
| 251 uint32_t fAdvBlendEqBlacklist; | 263 uint32_t fAdvBlendEqBlacklist; |
| 252 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); | 264 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); |
| 253 | 265 |
| 254 uint32_t fMapBufferFlags; | 266 uint32_t fMapBufferFlags; |
| 255 int fGeometryBufferMapThreshold; | 267 int fGeometryBufferMapThreshold; |
| 256 | 268 |
| 257 int fMaxRenderTargetSize; | 269 int fMaxRenderTargetSize; |
| 258 int fMaxTextureSize; | 270 int fMaxTextureSize; |
| 259 int fMaxTileSize; | 271 int fMaxTileSize; |
| 260 int fMaxSampleCount; | 272 int fMaxColorSampleCount; |
| 273 int fMaxStencilSampleCount; |
| 261 | 274 |
| 262 private: | 275 private: |
| 263 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; | 276 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; |
| 264 | 277 |
| 265 bool fSuppressPrints : 1; | 278 bool fSuppressPrints : 1; |
| 266 bool fImmediateFlush: 1; | 279 bool fImmediateFlush: 1; |
| 267 bool fDrawPathMasksToCompressedTextureSupport : 1; | 280 bool fDrawPathMasksToCompressedTextureSupport : 1; |
| 268 | 281 |
| 269 typedef SkRefCnt INHERITED; | 282 typedef SkRefCnt INHERITED; |
| 270 }; | 283 }; |
| 271 | 284 |
| 272 #endif | 285 #endif |
| OLD | NEW |