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 #include "GrGLCaps.h" | 9 #include "GrGLCaps.h" |
10 #include "GrGLContext.h" | 10 #include "GrGLContext.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 fUnpackRowLengthSupport = false; | 30 fUnpackRowLengthSupport = false; |
31 fUnpackFlipYSupport = false; | 31 fUnpackFlipYSupport = false; |
32 fPackRowLengthSupport = false; | 32 fPackRowLengthSupport = false; |
33 fPackFlipYSupport = false; | 33 fPackFlipYSupport = false; |
34 fTextureUsageSupport = false; | 34 fTextureUsageSupport = false; |
35 fTexStorageSupport = false; | 35 fTexStorageSupport = false; |
36 fTextureRedSupport = false; | 36 fTextureRedSupport = false; |
37 fImagingSupport = false; | 37 fImagingSupport = false; |
38 fTwoFormatLimit = false; | 38 fTwoFormatLimit = false; |
39 fFragCoordsConventionSupport = false; | 39 fFragCoordsConventionSupport = false; |
| 40 fVertexArrayObjectSupport = false; |
40 fUseNonVBOVertexAndIndexDynamicData = false; | 41 fUseNonVBOVertexAndIndexDynamicData = false; |
41 fIsCoreProfile = false; | 42 fIsCoreProfile = false; |
42 } | 43 } |
43 | 44 |
44 GrGLCaps::GrGLCaps(const GrGLCaps& caps) { | 45 GrGLCaps::GrGLCaps(const GrGLCaps& caps) { |
45 *this = caps; | 46 *this = caps; |
46 } | 47 } |
47 | 48 |
48 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { | 49 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { |
49 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; | 50 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; |
(...skipping 12 matching lines...) Expand all Loading... |
62 fUnpackRowLengthSupport = caps.fUnpackRowLengthSupport; | 63 fUnpackRowLengthSupport = caps.fUnpackRowLengthSupport; |
63 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; | 64 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; |
64 fPackRowLengthSupport = caps.fPackRowLengthSupport; | 65 fPackRowLengthSupport = caps.fPackRowLengthSupport; |
65 fPackFlipYSupport = caps.fPackFlipYSupport; | 66 fPackFlipYSupport = caps.fPackFlipYSupport; |
66 fTextureUsageSupport = caps.fTextureUsageSupport; | 67 fTextureUsageSupport = caps.fTextureUsageSupport; |
67 fTexStorageSupport = caps.fTexStorageSupport; | 68 fTexStorageSupport = caps.fTexStorageSupport; |
68 fTextureRedSupport = caps.fTextureRedSupport; | 69 fTextureRedSupport = caps.fTextureRedSupport; |
69 fImagingSupport = caps.fImagingSupport; | 70 fImagingSupport = caps.fImagingSupport; |
70 fTwoFormatLimit = caps.fTwoFormatLimit; | 71 fTwoFormatLimit = caps.fTwoFormatLimit; |
71 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; | 72 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; |
| 73 fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; |
72 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 74 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
73 fIsCoreProfile = caps.fIsCoreProfile; | 75 fIsCoreProfile = caps.fIsCoreProfile; |
74 | 76 |
75 return *this; | 77 return *this; |
76 } | 78 } |
77 | 79 |
78 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 80 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
79 | 81 |
80 this->reset(); | 82 this->reset(); |
81 if (!ctxInfo.isInitialized()) { | 83 if (!ctxInfo.isInitialized()) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn
fo.vendor())) { | 180 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn
fo.vendor())) { |
179 fUseNonVBOVertexAndIndexDynamicData = true; | 181 fUseNonVBOVertexAndIndexDynamicData = true; |
180 } | 182 } |
181 | 183 |
182 if (kDesktop_GrGLBinding == binding && version >= GR_GL_VER(3, 2)) { | 184 if (kDesktop_GrGLBinding == binding && version >= GR_GL_VER(3, 2)) { |
183 GrGLint profileMask; | 185 GrGLint profileMask; |
184 GR_GL_GetIntegerv(gli, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); | 186 GR_GL_GetIntegerv(gli, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); |
185 fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); | 187 fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); |
186 } | 188 } |
187 | 189 |
| 190 if (kDesktop_GrGLBinding == binding) { |
| 191 fVertexArrayObjectSupport = version >= GR_GL_VER(3, 0) || |
| 192 ctxInfo.hasExtension("GL_ARB_vertex_array_ob
ject"); |
| 193 } else { |
| 194 fVertexArrayObjectSupport = ctxInfo.hasExtension("GL_OES_vertex_array_ob
ject"); |
| 195 } |
| 196 |
188 this->initFSAASupport(ctxInfo, gli); | 197 this->initFSAASupport(ctxInfo, gli); |
189 this->initStencilFormats(ctxInfo); | 198 this->initStencilFormats(ctxInfo); |
190 } | 199 } |
191 | 200 |
192 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, | 201 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, |
193 GrGLenum format, | 202 GrGLenum format, |
194 GrGLenum type) const { | 203 GrGLenum type) const { |
195 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { | 204 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { |
196 // ES 2 guarantees this format is supported | 205 // ES 2 guarantees this format is supported |
197 return true; | 206 return true; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 (fUnpackRowLengthSupport ? "YES": "NO")); | 444 (fUnpackRowLengthSupport ? "YES": "NO")); |
436 GrPrintf("Unpack Flip Y support: %s\n", | 445 GrPrintf("Unpack Flip Y support: %s\n", |
437 (fUnpackFlipYSupport ? "YES": "NO")); | 446 (fUnpackFlipYSupport ? "YES": "NO")); |
438 GrPrintf("Pack Row length support: %s\n", | 447 GrPrintf("Pack Row length support: %s\n", |
439 (fPackRowLengthSupport ? "YES": "NO")); | 448 (fPackRowLengthSupport ? "YES": "NO")); |
440 GrPrintf("Pack Flip Y support: %s\n", | 449 GrPrintf("Pack Flip Y support: %s\n", |
441 (fPackFlipYSupport ? "YES": "NO")); | 450 (fPackFlipYSupport ? "YES": "NO")); |
442 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 451 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
443 GrPrintf("Fragment coord conventions support: %s\n", (fFragCoordsConventionS
upport ? "YES": "NO")); | 452 GrPrintf("Fragment coord conventions support: %s\n", (fFragCoordsConventionS
upport ? "YES": "NO")); |
444 } | 453 } |
OLD | NEW |