| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 GrShaderCaps(); | 56 GrShaderCaps(); |
| 57 | 57 |
| 58 virtual SkString dump() const; | 58 virtual SkString dump() const; |
| 59 | 59 |
| 60 bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; } | 60 bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; } |
| 61 bool geometryShaderSupport() const { return fGeometryShaderSupport; } | 61 bool geometryShaderSupport() const { return fGeometryShaderSupport; } |
| 62 bool pathRenderingSupport() const { return fPathRenderingSupport; } | 62 bool pathRenderingSupport() const { return fPathRenderingSupport; } |
| 63 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } | 63 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; } |
| 64 bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport;
} | 64 bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport;
} |
| 65 bool programmableSampleLocationsSupport() const { return fProgrammableSample
LocationsSupport; } | |
| 66 | 65 |
| 67 /** | 66 /** |
| 68 * Get the precision info for a variable of type kFloat_GrSLType, kVec2f_GrSL
Type, etc in a | 67 * Get the precision info for a variable of type kFloat_GrSLType, kVec2f_GrSL
Type, etc in a |
| 69 * given shader type. If the shader type is not supported or the precision le
vel is not | 68 * given shader type. If the shader type is not supported or the precision le
vel is not |
| 70 * supported in that shader type then the returned struct will report false w
hen supported() is | 69 * supported in that shader type then the returned struct will report false w
hen supported() is |
| 71 * called. | 70 * called. |
| 72 */ | 71 */ |
| 73 const PrecisionInfo& getFloatShaderPrecisionInfo(GrShaderType shaderType, | 72 const PrecisionInfo& getFloatShaderPrecisionInfo(GrShaderType shaderType, |
| 74 GrSLPrecision precision) const { | 73 GrSLPrecision precision) const { |
| 75 return fFloatPrecisions[shaderType][precision]; | 74 return fFloatPrecisions[shaderType][precision]; |
| 76 }; | 75 }; |
| 77 | 76 |
| 78 /** | 77 /** |
| 79 * Is there any difference between the float shader variable precision types?
If this is true | 78 * Is there any difference between the float shader variable precision types?
If this is true |
| 80 * then unless the shader type is not supported, any call to getFloatShaderPr
ecisionInfo() would | 79 * then unless the shader type is not supported, any call to getFloatShaderPr
ecisionInfo() would |
| 81 * report the same info for all precisions in all shader types. | 80 * report the same info for all precisions in all shader types. |
| 82 */ | 81 */ |
| 83 bool floatPrecisionVaries() const { return fShaderPrecisionVaries; } | 82 bool floatPrecisionVaries() const { return fShaderPrecisionVaries; } |
| 84 | 83 |
| 85 protected: | 84 protected: |
| 86 /** Subclasses must call this after initialization in order to apply caps ov
errides requested by | 85 /** Subclasses must call this after initialization in order to apply caps ov
errides requested by |
| 87 the client. Note that overrides will only reduce the caps never expand t
hem. */ | 86 the client. Note that overrides will only reduce the caps never expand t
hem. */ |
| 88 void applyOptionsOverrides(const GrContextOptions& options); | 87 void applyOptionsOverrides(const GrContextOptions& options); |
| 89 | 88 |
| 90 bool fShaderDerivativeSupport : 1; | 89 bool fShaderDerivativeSupport : 1; |
| 91 bool fGeometryShaderSupport : 1; | 90 bool fGeometryShaderSupport : 1; |
| 92 bool fPathRenderingSupport : 1; | 91 bool fPathRenderingSupport : 1; |
| 93 bool fDstReadInShaderSupport : 1; | 92 bool fDstReadInShaderSupport : 1; |
| 94 bool fDualSourceBlendingSupport : 1; | 93 bool fDualSourceBlendingSupport : 1; |
| 95 bool fProgrammableSampleLocationsSupport : 1; | |
| 96 | 94 |
| 97 bool fShaderPrecisionVaries; | 95 bool fShaderPrecisionVaries; |
| 98 PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; | 96 PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; |
| 99 | 97 |
| 100 private: | 98 private: |
| 101 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; | 99 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; |
| 102 typedef SkRefCnt INHERITED; | 100 typedef SkRefCnt INHERITED; |
| 103 }; | 101 }; |
| 104 | 102 |
| 105 /** | 103 /** |
| (...skipping 15 matching lines...) Expand all Loading... |
| 121 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } | 119 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; } |
| 122 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport
; } | 120 bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport
; } |
| 123 #if GR_FORCE_GPU_TRACE_DEBUGGING | 121 #if GR_FORCE_GPU_TRACE_DEBUGGING |
| 124 bool gpuTracingSupport() const { return true; } | 122 bool gpuTracingSupport() const { return true; } |
| 125 #else | 123 #else |
| 126 bool gpuTracingSupport() const { return fGpuTracingSupport; } | 124 bool gpuTracingSupport() const { return fGpuTracingSupport; } |
| 127 #endif | 125 #endif |
| 128 bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSup
port; } | 126 bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSup
port; } |
| 129 bool oversizedStencilSupport() const { return fOversizedStencilSupport; } | 127 bool oversizedStencilSupport() const { return fOversizedStencilSupport; } |
| 130 bool textureBarrierSupport() const { return fTextureBarrierSupport; } | 128 bool textureBarrierSupport() const { return fTextureBarrierSupport; } |
| 129 bool multisampleDisableSupport() const { return fMultisampleDisableSupport;
} |
| 130 bool programmableSampleLocationsSupport() const { return fProgrammableSample
LocationsSupport; } |
| 131 bool mixedSamplesSupport() const { return fMixedSamplesSupport; } | 131 bool mixedSamplesSupport() const { return fMixedSamplesSupport; } |
| 132 | 132 |
| 133 bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; } | 133 bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; } |
| 134 bool useDrawInsteadOfPartialRenderTargetWrite() const { | 134 bool useDrawInsteadOfPartialRenderTargetWrite() const { |
| 135 return fUseDrawInsteadOfPartialRenderTargetWrite; | 135 return fUseDrawInsteadOfPartialRenderTargetWrite; |
| 136 } | 136 } |
| 137 | 137 |
| 138 bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } | 138 bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } |
| 139 | 139 |
| 140 /** | 140 /** |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 bool fMipMapSupport : 1; | 239 bool fMipMapSupport : 1; |
| 240 bool fTwoSidedStencilSupport : 1; | 240 bool fTwoSidedStencilSupport : 1; |
| 241 bool fStencilWrapOpsSupport : 1; | 241 bool fStencilWrapOpsSupport : 1; |
| 242 bool fDiscardRenderTargetSupport : 1; | 242 bool fDiscardRenderTargetSupport : 1; |
| 243 bool fReuseScratchTextures : 1; | 243 bool fReuseScratchTextures : 1; |
| 244 bool fReuseScratchBuffers : 1; | 244 bool fReuseScratchBuffers : 1; |
| 245 bool fGpuTracingSupport : 1; | 245 bool fGpuTracingSupport : 1; |
| 246 bool fCompressedTexSubImageSupport : 1; | 246 bool fCompressedTexSubImageSupport : 1; |
| 247 bool fOversizedStencilSupport : 1; | 247 bool fOversizedStencilSupport : 1; |
| 248 bool fTextureBarrierSupport : 1; | 248 bool fTextureBarrierSupport : 1; |
| 249 bool fMultisampleDisableSupport : 1; |
| 250 bool fProgrammableSampleLocationsSupport : 1; |
| 249 bool fMixedSamplesSupport : 1; | 251 bool fMixedSamplesSupport : 1; |
| 250 bool fSupportsInstancedDraws : 1; | 252 bool fSupportsInstancedDraws : 1; |
| 251 bool fFullClearIsFree : 1; | 253 bool fFullClearIsFree : 1; |
| 252 bool fMustClearUploadedBufferData : 1; | 254 bool fMustClearUploadedBufferData : 1; |
| 253 | 255 |
| 254 // Driver workaround | 256 // Driver workaround |
| 255 bool fUseDrawInsteadOfClear : 1; | 257 bool fUseDrawInsteadOfClear : 1; |
| 256 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; | 258 bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; |
| 257 | 259 |
| 258 // ANGLE workaround | 260 // ANGLE workaround |
| (...skipping 18 matching lines...) Expand all Loading... |
| 277 private: | 279 private: |
| 278 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; | 280 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; |
| 279 | 281 |
| 280 bool fSupressPrints : 1; | 282 bool fSupressPrints : 1; |
| 281 bool fDrawPathMasksToCompressedTextureSupport : 1; | 283 bool fDrawPathMasksToCompressedTextureSupport : 1; |
| 282 | 284 |
| 283 typedef SkRefCnt INHERITED; | 285 typedef SkRefCnt INHERITED; |
| 284 }; | 286 }; |
| 285 | 287 |
| 286 #endif | 288 #endif |
| OLD | NEW |