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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 return fFloatPrecisions[shaderType][precision]; | 74 return fFloatPrecisions[shaderType][precision]; |
75 }; | 75 }; |
76 | 76 |
77 /** | 77 /** |
78 * 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 |
79 * 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 |
80 * report the same info for all precisions in all shader types. | 80 * report the same info for all precisions in all shader types. |
81 */ | 81 */ |
82 bool floatPrecisionVaries() const { return fShaderPrecisionVaries; } | 82 bool floatPrecisionVaries() const { return fShaderPrecisionVaries; } |
83 | 83 |
| 84 /** |
| 85 * PLS storage size in bytes (0 when not supported). The PLS spec defines a
minimum size of 16 |
| 86 * bytes whenever PLS is supported. |
| 87 */ |
| 88 int pixelLocalStorageSize() const { return fPixelLocalStorageSize; } |
| 89 |
| 90 /** |
| 91 * True if this context supports the necessary extensions and features to en
able the PLS path |
| 92 * renderer. |
| 93 */ |
| 94 bool plsPathRenderingSupport() const { |
| 95 #if GR_ENABLE_PLS_PATH_RENDERING |
| 96 return fPLSPathRenderingSupport; |
| 97 #else |
| 98 return false; |
| 99 #endif |
| 100 } |
| 101 |
84 protected: | 102 protected: |
85 /** Subclasses must call this after initialization in order to apply caps ov
errides requested by | 103 /** Subclasses must call this after initialization in order to apply caps ov
errides requested by |
86 the client. Note that overrides will only reduce the caps never expand t
hem. */ | 104 the client. Note that overrides will only reduce the caps never expand t
hem. */ |
87 void applyOptionsOverrides(const GrContextOptions& options); | 105 void applyOptionsOverrides(const GrContextOptions& options); |
88 | 106 |
89 bool fShaderDerivativeSupport : 1; | 107 bool fShaderDerivativeSupport : 1; |
90 bool fGeometryShaderSupport : 1; | 108 bool fGeometryShaderSupport : 1; |
91 bool fPathRenderingSupport : 1; | 109 bool fPathRenderingSupport : 1; |
92 bool fDstReadInShaderSupport : 1; | 110 bool fDstReadInShaderSupport : 1; |
93 bool fDualSourceBlendingSupport : 1; | 111 bool fDualSourceBlendingSupport : 1; |
94 | 112 |
95 bool fShaderPrecisionVaries; | 113 bool fShaderPrecisionVaries; |
96 PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; | 114 PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount]; |
| 115 int fPixelLocalStorageSize; |
| 116 bool fPLSPathRenderingSupport; |
97 | 117 |
98 private: | 118 private: |
99 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; | 119 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; |
100 typedef SkRefCnt INHERITED; | 120 typedef SkRefCnt INHERITED; |
101 }; | 121 }; |
102 | 122 |
103 /** | 123 /** |
104 * Represents the capabilities of a GrContext. | 124 * Represents the capabilities of a GrContext. |
105 */ | 125 */ |
106 class GrCaps : public SkRefCnt { | 126 class GrCaps : public SkRefCnt { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; | 296 virtual void onApplyOptionsOverrides(const GrContextOptions&) {}; |
277 | 297 |
278 bool fSuppressPrints : 1; | 298 bool fSuppressPrints : 1; |
279 bool fImmediateFlush: 1; | 299 bool fImmediateFlush: 1; |
280 bool fDrawPathMasksToCompressedTextureSupport : 1; | 300 bool fDrawPathMasksToCompressedTextureSupport : 1; |
281 | 301 |
282 typedef SkRefCnt INHERITED; | 302 typedef SkRefCnt INHERITED; |
283 }; | 303 }; |
284 | 304 |
285 #endif | 305 #endif |
OLD | NEW |