| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 fTextureUsageSupport = (kES2_GrGLBinding == binding) && | 155 fTextureUsageSupport = (kES2_GrGLBinding == binding) && |
| 156 ctxInfo.hasExtension("GL_ANGLE_texture_usage"); | 156 ctxInfo.hasExtension("GL_ANGLE_texture_usage"); |
| 157 | 157 |
| 158 // Tex storage is in desktop 4.2 and can be an extension to desktop or ES. | 158 // Tex storage is in desktop 4.2 and can be an extension to desktop or ES. |
| 159 fTexStorageSupport = (kDesktop_GrGLBinding == binding && | 159 fTexStorageSupport = (kDesktop_GrGLBinding == binding && |
| 160 version >= GR_GL_VER(4,2)) || | 160 version >= GR_GL_VER(4,2)) || |
| 161 ctxInfo.hasExtension("GL_ARB_texture_storage") || | 161 ctxInfo.hasExtension("GL_ARB_texture_storage") || |
| 162 ctxInfo.hasExtension("GL_EXT_texture_storage"); | 162 ctxInfo.hasExtension("GL_EXT_texture_storage"); |
| 163 | 163 |
| 164 // ARB_texture_rg is part of OpenGL 3.0 | 164 // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if |
| 165 // it doesn't have ARB_texture_rg extension. |
| 165 if (kDesktop_GrGLBinding == binding) { | 166 if (kDesktop_GrGLBinding == binding) { |
| 167 const GrGLubyte* verUByte; |
| 168 GR_GL_CALL_RET(gli, verUByte, GetString(GR_GL_VERSION)); |
| 169 const char* ver = reinterpret_cast<const char*>(verUByte); |
| 170 if (NULL != strstr(ver, "Mesa")) { |
| 171 fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg"); |
| 172 } else { |
| 166 fTextureRedSupport = version >= GR_GL_VER(3,0) || | 173 fTextureRedSupport = version >= GR_GL_VER(3,0) || |
| 167 ctxInfo.hasExtension("GL_ARB_texture_rg"); | 174 ctxInfo.hasExtension("GL_ARB_texture_rg"); |
| 175 } |
| 168 } else { | 176 } else { |
| 169 fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg"); | 177 fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg"); |
| 170 } | 178 } |
| 171 | 179 |
| 172 fImagingSupport = kDesktop_GrGLBinding == binding && | 180 fImagingSupport = kDesktop_GrGLBinding == binding && |
| 173 ctxInfo.hasExtension("GL_ARB_imaging"); | 181 ctxInfo.hasExtension("GL_ARB_imaging"); |
| 174 | 182 |
| 175 // ES 2 only guarantees RGBA/uchar + one other format/type combo for | 183 // ES 2 only guarantees RGBA/uchar + one other format/type combo for |
| 176 // ReadPixels. The other format has to checked at run-time since it | 184 // ReadPixels. The other format has to checked at run-time since it |
| 177 // can change based on which render target is bound | 185 // can change based on which render target is bound |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 586 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
| 579 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 587 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 580 GrPrintf("Fragment coord conventions support: %s\n", | 588 GrPrintf("Fragment coord conventions support: %s\n", |
| 581 (fFragCoordsConventionSupport ? "YES": "NO")); | 589 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 582 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); | 590 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); |
| 583 GrPrintf("Use non-VBO for dynamic data: %s\n", | 591 GrPrintf("Use non-VBO for dynamic data: %s\n", |
| 584 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 592 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 585 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); | 593 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); |
| 586 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); | 594 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); |
| 587 } | 595 } |
| OLD | NEW |