| 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 "GrGLContextInfo.h" | 10 #include "GrGLContextInfo.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) { | 78 void GrGLCaps::init(const GrGLContextInfo& ctxInfo) { |
| 77 | 79 |
| 78 this->reset(); | 80 this->reset(); |
| 79 if (!ctxInfo.isInitialized()) { | 81 if (!ctxInfo.isInitialized()) { |
| 80 return; | 82 return; |
| 81 } | 83 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 172 } |
| 171 | 173 |
| 172 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with | 174 // SGX and Mali GPUs that are based on a tiled-deferred architecture that ha
ve trouble with |
| 173 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex | 175 // frequently changing VBOs. We've measured a performance increase using non
-VBO vertex |
| 174 // data for dynamic content on these GPUs. Perhaps we should read the render
er string and | 176 // data for dynamic content on these GPUs. Perhaps we should read the render
er string and |
| 175 // limit this decision to specific GPU families rather than basing it on the
vendor alone. | 177 // limit this decision to specific GPU families rather than basing it on the
vendor alone. |
| 176 if (!GR_GL_MUST_USE_VBO && | 178 if (!GR_GL_MUST_USE_VBO && |
| 177 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn
fo.vendor())) { | 179 (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxIn
fo.vendor())) { |
| 178 fUseNonVBOVertexAndIndexDynamicData = true; | 180 fUseNonVBOVertexAndIndexDynamicData = true; |
| 179 } | 181 } |
| 182 |
| 183 if (kDesktop_GrGLBinding == binding && version >= GR_GL_VER(3, 2)) { |
| 184 GrGLint profileMask; |
| 185 GR_GL_GetIntegerv(ctxInfo.interface(), GR_GL_CONTEXT_PROFILE_MASK, &prof
ileMask); |
| 186 fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); |
| 187 } |
| 180 | 188 |
| 181 this->initFSAASupport(ctxInfo); | 189 this->initFSAASupport(ctxInfo); |
| 182 this->initStencilFormats(ctxInfo); | 190 this->initStencilFormats(ctxInfo); |
| 183 } | 191 } |
| 184 | 192 |
| 185 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, | 193 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, |
| 186 GrGLenum format, | 194 GrGLenum format, |
| 187 GrGLenum type) const { | 195 GrGLenum type) const { |
| 188 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { | 196 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { |
| 189 // ES 2 guarantees this format is supported | 197 // ES 2 guarantees this format is supported |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 (fUnpackRowLengthSupport ? "YES": "NO")); | 438 (fUnpackRowLengthSupport ? "YES": "NO")); |
| 431 GrPrintf("Unpack Flip Y support: %s\n", | 439 GrPrintf("Unpack Flip Y support: %s\n", |
| 432 (fUnpackFlipYSupport ? "YES": "NO")); | 440 (fUnpackFlipYSupport ? "YES": "NO")); |
| 433 GrPrintf("Pack Row length support: %s\n", | 441 GrPrintf("Pack Row length support: %s\n", |
| 434 (fPackRowLengthSupport ? "YES": "NO")); | 442 (fPackRowLengthSupport ? "YES": "NO")); |
| 435 GrPrintf("Pack Flip Y support: %s\n", | 443 GrPrintf("Pack Flip Y support: %s\n", |
| 436 (fPackFlipYSupport ? "YES": "NO")); | 444 (fPackFlipYSupport ? "YES": "NO")); |
| 437 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 445 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 438 GrPrintf("Fragment coord conventions support: %s\n", (fFragCoordsConventionS
upport ? "YES": "NO")); | 446 GrPrintf("Fragment coord conventions support: %s\n", (fFragCoordsConventionS
upport ? "YES": "NO")); |
| 439 } | 447 } |
| OLD | NEW |