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 "SkRefCnt.h" | 14 #include "SkRefCnt.h" |
15 #include "SkString.h" | 15 #include "SkString.h" |
16 | 16 |
17 struct GrContextOptions; | |
18 | |
19 class GrShaderCaps : public SkRefCnt { | 17 class GrShaderCaps : public SkRefCnt { |
20 public: | 18 public: |
21 SK_DECLARE_INST_COUNT(GrShaderCaps) | 19 SK_DECLARE_INST_COUNT(GrShaderCaps) |
22 | 20 |
23 /** Info about shader variable precision within a given shader stage. That i
s, this info | 21 /** Info about shader variable precision within a given shader stage. That i
s, this info |
24 is relevant to a float (or vecNf) variable declared with a GrSLPrecision | 22 is relevant to a float (or vecNf) variable declared with a GrSLPrecision |
25 in a given GrShaderType. The info here is hoisted from the OpenGL spec.
*/ | 23 in a given GrShaderType. The info here is hoisted from the OpenGL spec.
*/ |
26 struct PrecisionInfo { | 24 struct PrecisionInfo { |
27 PrecisionInfo() { | 25 PrecisionInfo() { |
28 fLogRangeLow = 0; | 26 fLogRangeLow = 0; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 typedef SkRefCnt INHERITED; | 96 typedef SkRefCnt INHERITED; |
99 }; | 97 }; |
100 | 98 |
101 /** | 99 /** |
102 * Represents the capabilities of a GrContext. | 100 * Represents the capabilities of a GrContext. |
103 */ | 101 */ |
104 class GrCaps : public SkRefCnt { | 102 class GrCaps : public SkRefCnt { |
105 public: | 103 public: |
106 SK_DECLARE_INST_COUNT(GrCaps) | 104 SK_DECLARE_INST_COUNT(GrCaps) |
107 | 105 |
108 GrCaps(const GrContextOptions&); | 106 GrCaps(); |
109 | 107 |
110 virtual SkString dump() const; | 108 virtual SkString dump() const; |
111 | 109 |
112 GrShaderCaps* shaderCaps() const { return fShaderCaps; } | 110 GrShaderCaps* shaderCaps() const { return fShaderCaps; } |
113 | 111 |
114 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } | 112 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } |
115 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor
t of MIP Maps (e.g. | 113 /** To avoid as-yet-unnecessary complexity we don't allow any partial suppor
t of MIP Maps (e.g. |
116 only for POT textures) */ | 114 only for POT textures) */ |
117 bool mipMapSupport() const { return fMipMapSupport; } | 115 bool mipMapSupport() const { return fMipMapSupport; } |
118 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } | 116 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { | 179 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { |
182 SkASSERT(kGrPixelConfigCnt > config); | 180 SkASSERT(kGrPixelConfigCnt > config); |
183 return fConfigRenderSupport[config][withMSAA]; | 181 return fConfigRenderSupport[config][withMSAA]; |
184 } | 182 } |
185 | 183 |
186 bool isConfigTexturable(GrPixelConfig config) const { | 184 bool isConfigTexturable(GrPixelConfig config) const { |
187 SkASSERT(kGrPixelConfigCnt > config); | 185 SkASSERT(kGrPixelConfigCnt > config); |
188 return fConfigTextureSupport[config]; | 186 return fConfigTextureSupport[config]; |
189 } | 187 } |
190 | 188 |
191 bool suppressPrints() const { return fSupressPrints; } | |
192 | |
193 bool drawPathMasksToCompressedTexturesSupport() const { | |
194 return fDrawPathMasksToCompressedTextureSupport; } | |
195 | |
196 protected: | 189 protected: |
197 SkAutoTUnref<GrShaderCaps> fShaderCaps; | 190 SkAutoTUnref<GrShaderCaps> fShaderCaps; |
198 | 191 |
199 bool fNPOTTextureTileSupport : 1; | 192 bool fNPOTTextureTileSupport : 1; |
200 bool fMipMapSupport : 1; | 193 bool fMipMapSupport : 1; |
201 bool fTwoSidedStencilSupport : 1; | 194 bool fTwoSidedStencilSupport : 1; |
202 bool fStencilWrapOpsSupport : 1; | 195 bool fStencilWrapOpsSupport : 1; |
203 bool fDiscardRenderTargetSupport : 1; | 196 bool fDiscardRenderTargetSupport : 1; |
204 bool fReuseScratchTextures : 1; | 197 bool fReuseScratchTextures : 1; |
205 bool fGpuTracingSupport : 1; | 198 bool fGpuTracingSupport : 1; |
206 bool fCompressedTexSubImageSupport : 1; | 199 bool fCompressedTexSubImageSupport : 1; |
207 bool fOversizedStencilSupport : 1; | 200 bool fOversizedStencilSupport : 1; |
208 bool fTextureBarrierSupport : 1; | 201 bool fTextureBarrierSupport : 1; |
209 // Driver workaround | 202 // Driver workaround |
210 bool fUseDrawInsteadOfClear : 1; | 203 bool fUseDrawInsteadOfClear : 1; |
211 | 204 |
212 BlendEquationSupport fBlendEquationSupport; | 205 BlendEquationSupport fBlendEquationSupport; |
213 uint32_t fMapBufferFlags; | 206 uint32_t fMapBufferFlags; |
214 | 207 |
215 int fMaxRenderTargetSize; | 208 int fMaxRenderTargetSize; |
216 int fMaxTextureSize; | 209 int fMaxTextureSize; |
217 int fMaxSampleCount; | 210 int fMaxSampleCount; |
218 | 211 |
219 // The first entry for each config is without msaa and the second is with. | 212 // The first entry for each config is without msaa and the second is with. |
220 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; | 213 bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
221 bool fConfigTextureSupport[kGrPixelConfigCnt]; | 214 bool fConfigTextureSupport[kGrPixelConfigCnt]; |
222 | 215 |
223 private: | 216 private: |
224 bool fSupressPrints : 1; | |
225 bool fDrawPathMasksToCompressedTextureSupport : 1; | |
226 | |
227 typedef SkRefCnt INHERITED; | 217 typedef SkRefCnt INHERITED; |
228 }; | 218 }; |
229 | 219 |
230 #endif | 220 #endif |
OLD | NEW |