| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 only for POT textures) */ | 136 only for POT textures) */ |
| 137 bool mipMapSupport() const { return fMipMapSupport; } | 137 bool mipMapSupport() const { return fMipMapSupport; } |
| 138 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } | 138 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } |
| 139 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } | 139 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } |
| 140 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport
; } | 140 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport
; } |
| 141 bool gpuTracingSupport() const { return fGpuTracingSupport; } | 141 bool gpuTracingSupport() const { return fGpuTracingSupport; } |
| 142 bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSup
port; } | 142 bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSup
port; } |
| 143 bool oversizedStencilSupport() const { return fOversizedStencilSupport; } | 143 bool oversizedStencilSupport() const { return fOversizedStencilSupport; } |
| 144 bool textureBarrierSupport() const { return fTextureBarrierSupport; } | 144 bool textureBarrierSupport() const { return fTextureBarrierSupport; } |
| 145 bool usesMixedSamples() const { return fUsesMixedSamples; } | 145 bool usesMixedSamples() const { return fUsesMixedSamples; } |
| 146 /** "Raster multisample" is a special HW mode where the rasterizer runs more
samples than are in |
| 147 the target framebuffer. */ |
| 148 bool rasterMultisampleSupport() const { return fRasterMultisampleSupport; } |
| 146 | 149 |
| 147 bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; } | 150 bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; } |
| 148 bool useDrawInsteadOfPartialRenderTargetWrite() const { | 151 bool useDrawInsteadOfPartialRenderTargetWrite() const { |
| 149 return fUseDrawInsteadOfPartialRenderTargetWrite; | 152 return fUseDrawInsteadOfPartialRenderTargetWrite; |
| 150 } | 153 } |
| 151 | 154 |
| 152 bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } | 155 bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } |
| 153 | 156 |
| 154 /** | 157 /** |
| 155 * Indicates the capabilities of the fixed function blend unit. | 158 * Indicates the capabilities of the fixed function blend unit. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 int maxStencilSampleCount() const { return fMaxStencilSampleCount; } | 216 int maxStencilSampleCount() const { return fMaxStencilSampleCount; } |
| 214 // We require the sample count to be less than maxColorSampleCount and maxSt
encilSampleCount. | 217 // We require the sample count to be less than maxColorSampleCount and maxSt
encilSampleCount. |
| 215 // If we are using mixed samples, we only care about stencil. | 218 // If we are using mixed samples, we only care about stencil. |
| 216 int maxSampleCount() const { | 219 int maxSampleCount() const { |
| 217 if (this->usesMixedSamples()) { | 220 if (this->usesMixedSamples()) { |
| 218 return this->maxStencilSampleCount(); | 221 return this->maxStencilSampleCount(); |
| 219 } else { | 222 } else { |
| 220 return SkTMin(this->maxColorSampleCount(), this->maxStencilSampleCou
nt()); | 223 return SkTMin(this->maxColorSampleCount(), this->maxStencilSampleCou
nt()); |
| 221 } | 224 } |
| 222 } | 225 } |
| 226 // This can only be called if raster multisample is supported. |
| 227 int maxRasterSamples() const { |
| 228 SkASSERT(this->rasterMultisampleSupport()); |
| 229 return fMaxRasterSamples; |
| 230 } |
| 223 | 231 |
| 224 | 232 |
| 225 virtual bool isConfigTexturable(GrPixelConfig config) const = 0; | 233 virtual bool isConfigTexturable(GrPixelConfig config) const = 0; |
| 226 virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const =
0; | 234 virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const =
0; |
| 227 | 235 |
| 228 bool suppressPrints() const { return fSuppressPrints; } | 236 bool suppressPrints() const { return fSuppressPrints; } |
| 229 | 237 |
| 230 bool immediateFlush() const { return fImmediateFlush; } | 238 bool immediateFlush() const { return fImmediateFlush; } |
| 231 | 239 |
| 232 bool drawPathMasksToCompressedTexturesSupport() const { | 240 bool drawPathMasksToCompressedTexturesSupport() const { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 261 bool fTwoSidedStencilSupport : 1; | 269 bool fTwoSidedStencilSupport : 1; |
| 262 bool fStencilWrapOpsSupport : 1; | 270 bool fStencilWrapOpsSupport : 1; |
| 263 bool fDiscardRenderTargetSupport : 1; | 271 bool fDiscardRenderTargetSupport : 1; |
| 264 bool fReuseScratchTextures : 1; | 272 bool fReuseScratchTextures : 1; |
| 265 bool fReuseScratchBuffers : 1; | 273 bool fReuseScratchBuffers : 1; |
| 266 bool fGpuTracingSupport : 1; | 274 bool fGpuTracingSupport : 1; |
| 267 bool fCompressedTexSubImageSupport : 1; | 275 bool fCompressedTexSubImageSupport : 1; |
| 268 bool fOversizedStencilSupport : 1; | 276 bool fOversizedStencilSupport : 1; |
| 269 bool fTextureBarrierSupport : 1; | 277 bool fTextureBarrierSupport : 1; |
| 270 bool fUsesMixedSamples : 1; | 278 bool fUsesMixedSamples : 1; |
| 279 bool fRasterMultisampleSupport : 1; |
| 271 bool fSupportsInstancedDraws : 1; | 280 bool fSupportsInstancedDraws : 1; |
| 272 bool fFullClearIsFree : 1; | 281 bool fFullClearIsFree : 1; |
| 273 bool fMustClearUploadedBufferData : 1; | 282 bool fMustClearUploadedBufferData : 1; |
| 274 | 283 |
| 275 // Driver workaround | 284 // Driver workaround |
| 276 bool fUseDrawInsteadOfClear : 1; | 285 bool fUseDrawInsteadOfClear : 1; |
| 277 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; | 286 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; |
| 278 | 287 |
| 279 // ANGLE workaround | 288 // ANGLE workaround |
| 280 bool fPreferVRAMUseOverFlushes : 1; | 289 bool fPreferVRAMUseOverFlushes : 1; |
| 281 | 290 |
| 282 BlendEquationSupport fBlendEquationSupport; | 291 BlendEquationSupport fBlendEquationSupport; |
| 283 uint32_t fAdvBlendEqBlacklist; | 292 uint32_t fAdvBlendEqBlacklist; |
| 284 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); | 293 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); |
| 285 | 294 |
| 286 uint32_t fMapBufferFlags; | 295 uint32_t fMapBufferFlags; |
| 287 int fGeometryBufferMapThreshold; | 296 int fGeometryBufferMapThreshold; |
| 288 | 297 |
| 289 int fMaxRenderTargetSize; | 298 int fMaxRenderTargetSize; |
| 290 int fMaxTextureSize; | 299 int fMaxTextureSize; |
| 291 int fMaxTileSize; | 300 int fMaxTileSize; |
| 292 int fMaxColorSampleCount; | 301 int fMaxColorSampleCount; |
| 293 int fMaxStencilSampleCount; | 302 int fMaxStencilSampleCount; |
| 303 int fMaxRasterSamples; |
| 294 | 304 |
| 295 private: | 305 private: |
| 296 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; | 306 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; |
| 297 | 307 |
| 298 bool fSuppressPrints : 1; | 308 bool fSuppressPrints : 1; |
| 299 bool fImmediateFlush: 1; | 309 bool fImmediateFlush: 1; |
| 300 bool fDrawPathMasksToCompressedTextureSupport : 1; | 310 bool fDrawPathMasksToCompressedTextureSupport : 1; |
| 301 | 311 |
| 302 typedef SkRefCnt INHERITED; | 312 typedef SkRefCnt INHERITED; |
| 303 }; | 313 }; |
| 304 | 314 |
| 305 #endif | 315 #endif |
| OLD | NEW |