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 |
11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
12 #include "GrTypesPriv.h" | 12 #include "GrTypesPriv.h" |
13 #include "GrShaderVar.h" | 13 #include "GrShaderVar.h" |
| 14 #include "GrXferProcessor.h" |
14 #include "SkRefCnt.h" | 15 #include "SkRefCnt.h" |
15 #include "SkString.h" | 16 #include "SkString.h" |
16 | 17 |
17 struct GrContextOptions; | 18 struct GrContextOptions; |
18 | 19 |
19 class GrShaderCaps : public SkRefCnt { | 20 class GrShaderCaps : public SkRefCnt { |
20 public: | 21 public: |
21 SK_DECLARE_INST_COUNT(GrShaderCaps) | 22 SK_DECLARE_INST_COUNT(GrShaderCaps) |
22 | 23 |
23 /** Info about shader variable precision within a given shader stage. That i
s, this info | 24 /** Info about shader variable precision within a given shader stage. That i
s, this info |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 BlendEquationSupport blendEquationSupport() const { return fBlendEquationSup
port; } | 152 BlendEquationSupport blendEquationSupport() const { return fBlendEquationSup
port; } |
152 | 153 |
153 bool advancedBlendEquationSupport() const { | 154 bool advancedBlendEquationSupport() const { |
154 return fBlendEquationSupport >= kAdvanced_BlendEquationSupport; | 155 return fBlendEquationSupport >= kAdvanced_BlendEquationSupport; |
155 } | 156 } |
156 | 157 |
157 bool advancedCoherentBlendEquationSupport() const { | 158 bool advancedCoherentBlendEquationSupport() const { |
158 return kAdvancedCoherent_BlendEquationSupport == fBlendEquationSupport; | 159 return kAdvancedCoherent_BlendEquationSupport == fBlendEquationSupport; |
159 } | 160 } |
160 | 161 |
| 162 bool advancedBlendEquationIsBlacklist(GrBlendEquation equation) const { |
| 163 return fAdvBlendEqBlacklist & (1 << equation); |
| 164 } |
| 165 |
161 /** | 166 /** |
162 * Indicates whether GPU->CPU memory mapping for GPU resources such as verte
x buffers and | 167 * Indicates whether GPU->CPU memory mapping for GPU resources such as verte
x buffers and |
163 * textures allows partial mappings or full mappings. | 168 * textures allows partial mappings or full mappings. |
164 */ | 169 */ |
165 enum MapFlags { | 170 enum MapFlags { |
166 kNone_MapFlags = 0x0, //<! Cannot map the resource. | 171 kNone_MapFlags = 0x0, //<! Cannot map the resource. |
167 | 172 |
168 kCanMap_MapFlag = 0x1, //<! The resource can be mapped. Must be s
et for any of | 173 kCanMap_MapFlag = 0x1, //<! The resource can be mapped. Must be s
et for any of |
169 // the other flags to have meaning.k | 174 // the other flags to have meaning.k |
170 kSubset_MapFlag = 0x2, //<! The resource can be partially mapped. | 175 kSubset_MapFlag = 0x2, //<! The resource can be partially mapped. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 bool fDiscardRenderTargetSupport : 1; | 227 bool fDiscardRenderTargetSupport : 1; |
223 bool fReuseScratchTextures : 1; | 228 bool fReuseScratchTextures : 1; |
224 bool fGpuTracingSupport : 1; | 229 bool fGpuTracingSupport : 1; |
225 bool fCompressedTexSubImageSupport : 1; | 230 bool fCompressedTexSubImageSupport : 1; |
226 bool fOversizedStencilSupport : 1; | 231 bool fOversizedStencilSupport : 1; |
227 bool fTextureBarrierSupport : 1; | 232 bool fTextureBarrierSupport : 1; |
228 // Driver workaround | 233 // Driver workaround |
229 bool fUseDrawInsteadOfClear : 1; | 234 bool fUseDrawInsteadOfClear : 1; |
230 | 235 |
231 BlendEquationSupport fBlendEquationSupport; | 236 BlendEquationSupport fBlendEquationSupport; |
| 237 uint32_t fAdvBlendEqBlacklist; |
| 238 GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); |
| 239 |
232 uint32_t fMapBufferFlags; | 240 uint32_t fMapBufferFlags; |
233 int fGeometryBufferMapThreshold; | 241 int fGeometryBufferMapThreshold; |
234 | 242 |
235 int fMaxRenderTargetSize; | 243 int fMaxRenderTargetSize; |
236 int fMaxTextureSize; | 244 int fMaxTextureSize; |
237 int fMinTextureSize; | 245 int fMinTextureSize; |
238 int fMaxSampleCount; | 246 int fMaxSampleCount; |
239 | 247 |
240 // The first entry for each config is without msaa and the second is with. | 248 // The first entry for each config is without msaa and the second is with. |
241 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; | 249 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
242 bool fConfigTextureSupport[kGrPixelConfigCnt]; | 250 bool fConfigTextureSupport[kGrPixelConfigCnt]; |
243 | 251 |
244 private: | 252 private: |
245 bool fSupressPrints : 1; | 253 bool fSupressPrints : 1; |
246 bool fDrawPathMasksToCompressedTextureSupport : 1; | 254 bool fDrawPathMasksToCompressedTextureSupport : 1; |
247 | 255 |
248 typedef SkRefCnt INHERITED; | 256 typedef SkRefCnt INHERITED; |
249 }; | 257 }; |
250 | 258 |
251 #endif | 259 #endif |
OLD | NEW |