OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #ifndef GrGLCaps_DEFINED | 9 #ifndef GrGLCaps_DEFINED |
10 #define GrGLCaps_DEFINED | 10 #define GrGLCaps_DEFINED |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 }; | 79 }; |
80 | 80 |
81 enum InvalidateFBType { | 81 enum InvalidateFBType { |
82 kNone_InvalidateFBType, | 82 kNone_InvalidateFBType, |
83 kDiscard_InvalidateFBType, //<! glDiscardFramebuffer() | 83 kDiscard_InvalidateFBType, //<! glDiscardFramebuffer() |
84 kInvalidate_InvalidateFBType, //<! glInvalidateFramebuffer() | 84 kInvalidate_InvalidateFBType, //<! glInvalidateFramebuffer() |
85 | 85 |
86 kLast_InvalidateFBType = kInvalidate_InvalidateFBType | 86 kLast_InvalidateFBType = kInvalidate_InvalidateFBType |
87 }; | 87 }; |
88 | 88 |
89 enum MapBufferType { | |
90 kNone_MapBufferType, | |
91 kMapBuffer_MapBufferType, // glMapBuffer() | |
92 kMapBufferRange_MapBufferType, // glMapBufferRange() | |
93 kChromium_MapBufferType, // GL_CHROMIUM_map_sub | |
94 | |
95 kLast_MapBufferType = kChromium_MapBufferType, | |
96 }; | |
97 | |
98 /** | 89 /** |
99 * Creates a GrGLCaps that advertises no support for any extensions, | 90 * Creates a GrGLCaps that advertises no support for any extensions, |
100 * formats, etc. Call init to initialize from a GrGLContextInfo. | 91 * formats, etc. Call init to initialize from a GrGLContextInfo. |
101 */ | 92 */ |
102 GrGLCaps(); | 93 GrGLCaps(); |
103 | 94 |
104 GrGLCaps(const GrGLCaps& caps); | 95 GrGLCaps(const GrGLCaps& caps); |
105 | 96 |
106 GrGLCaps& operator = (const GrGLCaps& caps); | 97 GrGLCaps& operator = (const GrGLCaps& caps); |
107 | 98 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 */ | 162 */ |
172 bool usesImplicitMSAAResolve() const { | 163 bool usesImplicitMSAAResolve() const { |
173 return kES_IMG_MsToTexture_MSFBOType == fMSFBOType || | 164 return kES_IMG_MsToTexture_MSFBOType == fMSFBOType || |
174 kES_EXT_MsToTexture_MSFBOType == fMSFBOType; | 165 kES_EXT_MsToTexture_MSFBOType == fMSFBOType; |
175 } | 166 } |
176 | 167 |
177 FBFetchType fbFetchType() const { return fFBFetchType; } | 168 FBFetchType fbFetchType() const { return fFBFetchType; } |
178 | 169 |
179 InvalidateFBType invalidateFBType() const { return fInvalidateFBType; } | 170 InvalidateFBType invalidateFBType() const { return fInvalidateFBType; } |
180 | 171 |
181 /// What type of buffer mapping is supported? | 172 /** |
182 MapBufferType mapBufferType() const { return fMapBufferType; } | 173 * Returs a string containeng the caps info. |
| 174 */ |
| 175 virtual SkString dump() const SK_OVERRIDE; |
183 | 176 |
184 /** | 177 /** |
185 * Gets an array of legal stencil formats. These formats are not guaranteed | 178 * Gets an array of legal stencil formats. These formats are not guaranteed |
186 * to be supported by the driver but are legal GLenum names given the GL | 179 * to be supported by the driver but are legal GLenum names given the GL |
187 * version and extensions supported. | 180 * version and extensions supported. |
188 */ | 181 */ |
189 const SkTArray<StencilFormat, true>& stencilFormats() const { | 182 const SkTArray<StencilFormat, true>& stencilFormats() const { |
190 return fStencilFormats; | 183 return fStencilFormats; |
191 } | 184 } |
192 | 185 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 GrGLenum format, | 251 GrGLenum format, |
259 GrGLenum type) const; | 252 GrGLenum type) const; |
260 | 253 |
261 bool isCoreProfile() const { return fIsCoreProfile; } | 254 bool isCoreProfile() const { return fIsCoreProfile; } |
262 | 255 |
263 | 256 |
264 bool fullClearIsFree() const { return fFullClearIsFree; } | 257 bool fullClearIsFree() const { return fFullClearIsFree; } |
265 | 258 |
266 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } | 259 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } |
267 | 260 |
268 /** | 261 /// Is GL_CHROMIUM_map_sub supported? |
269 * Returns a string containing the caps info. | 262 bool mapSubSupport() const { return fMapSubSupport; } |
270 */ | |
271 virtual SkString dump() const SK_OVERRIDE; | |
272 | 263 |
273 private: | 264 private: |
274 /** | 265 /** |
275 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly | 266 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly |
276 * performing glCheckFrameBufferStatus for the same config. | 267 * performing glCheckFrameBufferStatus for the same config. |
277 */ | 268 */ |
278 struct VerifiedColorConfigs { | 269 struct VerifiedColorConfigs { |
279 VerifiedColorConfigs() { | 270 VerifiedColorConfigs() { |
280 this->reset(); | 271 this->reset(); |
281 } | 272 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 SkTArray<VerifiedColorConfigs, true> fStencilVerifiedColorConfigs; | 315 SkTArray<VerifiedColorConfigs, true> fStencilVerifiedColorConfigs; |
325 | 316 |
326 int fMaxFragmentUniformVectors; | 317 int fMaxFragmentUniformVectors; |
327 int fMaxVertexAttributes; | 318 int fMaxVertexAttributes; |
328 int fMaxFragmentTextureUnits; | 319 int fMaxFragmentTextureUnits; |
329 int fMaxFixedFunctionTextureCoords; | 320 int fMaxFixedFunctionTextureCoords; |
330 | 321 |
331 MSFBOType fMSFBOType; | 322 MSFBOType fMSFBOType; |
332 FBFetchType fFBFetchType; | 323 FBFetchType fFBFetchType; |
333 InvalidateFBType fInvalidateFBType; | 324 InvalidateFBType fInvalidateFBType; |
334 MapBufferType fMapBufferType; | |
335 | 325 |
336 bool fRGBA8RenderbufferSupport : 1; | 326 bool fRGBA8RenderbufferSupport : 1; |
337 bool fBGRAFormatSupport : 1; | 327 bool fBGRAFormatSupport : 1; |
338 bool fBGRAIsInternalFormat : 1; | 328 bool fBGRAIsInternalFormat : 1; |
339 bool fTextureSwizzleSupport : 1; | 329 bool fTextureSwizzleSupport : 1; |
340 bool fUnpackRowLengthSupport : 1; | 330 bool fUnpackRowLengthSupport : 1; |
341 bool fUnpackFlipYSupport : 1; | 331 bool fUnpackFlipYSupport : 1; |
342 bool fPackRowLengthSupport : 1; | 332 bool fPackRowLengthSupport : 1; |
343 bool fPackFlipYSupport : 1; | 333 bool fPackFlipYSupport : 1; |
344 bool fTextureUsageSupport : 1; | 334 bool fTextureUsageSupport : 1; |
345 bool fTexStorageSupport : 1; | 335 bool fTexStorageSupport : 1; |
346 bool fTextureRedSupport : 1; | 336 bool fTextureRedSupport : 1; |
347 bool fImagingSupport : 1; | 337 bool fImagingSupport : 1; |
348 bool fTwoFormatLimit : 1; | 338 bool fTwoFormatLimit : 1; |
349 bool fFragCoordsConventionSupport : 1; | 339 bool fFragCoordsConventionSupport : 1; |
350 bool fVertexArrayObjectSupport : 1; | 340 bool fVertexArrayObjectSupport : 1; |
351 bool fUseNonVBOVertexAndIndexDynamicData : 1; | 341 bool fUseNonVBOVertexAndIndexDynamicData : 1; |
352 bool fIsCoreProfile : 1; | 342 bool fIsCoreProfile : 1; |
353 bool fFullClearIsFree : 1; | 343 bool fFullClearIsFree : 1; |
354 bool fDropsTileOnZeroDivide : 1; | 344 bool fDropsTileOnZeroDivide : 1; |
| 345 bool fMapSubSupport : 1; |
355 | 346 |
356 typedef GrDrawTargetCaps INHERITED; | 347 typedef GrDrawTargetCaps INHERITED; |
357 }; | 348 }; |
358 | 349 |
359 #endif | 350 #endif |
OLD | NEW |