| 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 20 matching lines...) Expand all Loading... |
| 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 fUseNonVBOVertexAndIndexDynamicData = false; | 40 fUseNonVBOVertexAndIndexDynamicData = false; |
| 41 fIsCoreProfile = false; |
| 41 } | 42 } |
| 42 | 43 |
| 43 GrGLCaps::GrGLCaps(const GrGLCaps& caps) { | 44 GrGLCaps::GrGLCaps(const GrGLCaps& caps) { |
| 44 *this = caps; | 45 *this = caps; |
| 45 } | 46 } |
| 46 | 47 |
| 47 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { | 48 GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { |
| 48 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; | 49 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; |
| 49 fStencilFormats = caps.fStencilFormats; | 50 fStencilFormats = caps.fStencilFormats; |
| 50 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; | 51 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; | 63 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; |
| 63 fPackRowLengthSupport = caps.fPackRowLengthSupport; | 64 fPackRowLengthSupport = caps.fPackRowLengthSupport; |
| 64 fPackFlipYSupport = caps.fPackFlipYSupport; | 65 fPackFlipYSupport = caps.fPackFlipYSupport; |
| 65 fTextureUsageSupport = caps.fTextureUsageSupport; | 66 fTextureUsageSupport = caps.fTextureUsageSupport; |
| 66 fTexStorageSupport = caps.fTexStorageSupport; | 67 fTexStorageSupport = caps.fTexStorageSupport; |
| 67 fTextureRedSupport = caps.fTextureRedSupport; | 68 fTextureRedSupport = caps.fTextureRedSupport; |
| 68 fImagingSupport = caps.fImagingSupport; | 69 fImagingSupport = caps.fImagingSupport; |
| 69 fTwoFormatLimit = caps.fTwoFormatLimit; | 70 fTwoFormatLimit = caps.fTwoFormatLimit; |
| 70 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; | 71 fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; |
| 71 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; | 72 fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicDa
ta; |
| 73 fIsCoreProfile = caps.fIsCoreProfile; |
| 72 | 74 |
| 73 return *this; | 75 return *this; |
| 74 } | 76 } |
| 75 | 77 |
| 76 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { | 78 void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { |
| 77 | 79 |
| 78 this->reset(); | 80 this->reset(); |
| 79 if (!ctxInfo.isInitialized()) { | 81 if (!ctxInfo.isInitialized()) { |
| 80 return; | 82 return; |
| 81 } | 83 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 171 } |
| 170 | 172 |
| 171 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with | 173 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with |
| 172 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex | 174 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex |
| 173 // data for dynamic content on these GPUs. Perhaps we should read the render
er string and | 175 // data for dynamic content on these GPUs. Perhaps we should read the render
er string and |
| 174 // limit this decision to specific GPU families rather than basing it on the
vendor alone. | 176 // limit this decision to specific GPU families rather than basing it on the
vendor alone. |
| 175 if (!GR_GL_MUST_USE_VBO && | 177 if (!GR_GL_MUST_USE_VBO && |
| 176 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn
fo.vendor())) { | 178 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn
fo.vendor())) { |
| 177 fUseNonVBOVertexAndIndexDynamicData = true; | 179 fUseNonVBOVertexAndIndexDynamicData = true; |
| 178 } | 180 } |
| 181 |
| 182 if (kDesktop_GrGLBinding == binding && version >= GR_GL_VER(3, 2)) { |
| 183 GrGLint profileMask; |
| 184 GR_GL_GetIntegerv(gli, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); |
| 185 fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); |
| 186 } |
| 179 | 187 |
| 180 this->initFSAASupport(ctxInfo, gli); | 188 this->initFSAASupport(ctxInfo, gli); |
| 181 this->initStencilFormats(ctxInfo); | 189 this->initStencilFormats(ctxInfo); |
| 182 } | 190 } |
| 183 | 191 |
| 184 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, | 192 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, |
| 185 GrGLenum format, | 193 GrGLenum format, |
| 186 GrGLenum type) const { | 194 GrGLenum type) const { |
| 187 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { | 195 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { |
| 188 // ES 2 guarantees this format is supported | 196 // ES 2 guarantees this format is supported |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 (fUnpackRowLengthSupport ? "YES": "NO")); | 435 (fUnpackRowLengthSupport ? "YES": "NO")); |
| 428 GrPrintf("Unpack Flip Y support: %s\n", | 436 GrPrintf("Unpack Flip Y support: %s\n", |
| 429 (fUnpackFlipYSupport ? "YES": "NO")); | 437 (fUnpackFlipYSupport ? "YES": "NO")); |
| 430 GrPrintf("Pack Row length support: %s\n", | 438 GrPrintf("Pack Row length support: %s\n", |
| 431 (fPackRowLengthSupport ? "YES": "NO")); | 439 (fPackRowLengthSupport ? "YES": "NO")); |
| 432 GrPrintf("Pack Flip Y support: %s\n", | 440 GrPrintf("Pack Flip Y support: %s\n", |
| 433 (fPackFlipYSupport ? "YES": "NO")); | 441 (fPackFlipYSupport ? "YES": "NO")); |
| 434 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 442 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 435 GrPrintf("Fragment coord conventions support: %s\n", (fFragCoordsConventionS
upport ? "YES": "NO")); | 443 GrPrintf("Fragment coord conventions support: %s\n", (fFragCoordsConventionS
upport ? "YES": "NO")); |
| 436 } | 444 } |
| OLD | NEW |