| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 GrGLint max; | 109 GrGLint max; |
| 110 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); | 110 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); |
| 111 fMaxFragmentUniformVectors = max / 4; | 111 fMaxFragmentUniformVectors = max / 4; |
| 112 } | 112 } |
| 113 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); | 113 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); |
| 114 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn
its); | 114 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn
its); |
| 115 | 115 |
| 116 if (kDesktop_GrGLBinding == binding) { | 116 if (kDesktop_GrGLBinding == binding) { |
| 117 fRGBA8RenderbufferSupport = true; | 117 fRGBA8RenderbufferSupport = true; |
| 118 } else { | 118 } else { |
| 119 fRGBA8RenderbufferSupport = ctxInfo.hasExtension("GL_OES_rgb8_rgba8") || | 119 fRGBA8RenderbufferSupport = version >= GR_GL_VER(3,0) || |
| 120 ctxInfo.hasExtension("GL_OES_rgb8_rgba8") || |
| 120 ctxInfo.hasExtension("GL_ARM_rgba8"); | 121 ctxInfo.hasExtension("GL_ARM_rgba8"); |
| 121 } | 122 } |
| 122 | 123 |
| 123 if (kDesktop_GrGLBinding == binding) { | 124 if (kDesktop_GrGLBinding == binding) { |
| 124 fBGRAFormatSupport = version >= GR_GL_VER(1,2) || | 125 fBGRAFormatSupport = version >= GR_GL_VER(1,2) || |
| 125 ctxInfo.hasExtension("GL_EXT_bgra"); | 126 ctxInfo.hasExtension("GL_EXT_bgra"); |
| 126 } else { | 127 } else { |
| 127 if (ctxInfo.hasExtension("GL_APPLE_texture_format_BGRA8888")) { | 128 if (ctxInfo.hasExtension("GL_APPLE_texture_format_BGRA8888")) { |
| 128 fBGRAFormatSupport = true; | 129 fBGRAFormatSupport = true; |
| 129 } else if (ctxInfo.hasExtension("GL_EXT_texture_format_BGRA8888")) { | 130 } else if (ctxInfo.hasExtension("GL_EXT_texture_format_BGRA8888")) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if | 169 // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if |
| 169 // it doesn't have ARB_texture_rg extension. | 170 // it doesn't have ARB_texture_rg extension. |
| 170 if (kDesktop_GrGLBinding == binding) { | 171 if (kDesktop_GrGLBinding == binding) { |
| 171 if (ctxInfo.isMesa()) { | 172 if (ctxInfo.isMesa()) { |
| 172 fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg"); | 173 fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg"); |
| 173 } else { | 174 } else { |
| 174 fTextureRedSupport = version >= GR_GL_VER(3,0) || | 175 fTextureRedSupport = version >= GR_GL_VER(3,0) || |
| 175 ctxInfo.hasExtension("GL_ARB_texture_rg"); | 176 ctxInfo.hasExtension("GL_ARB_texture_rg"); |
| 176 } | 177 } |
| 177 } else { | 178 } else { |
| 178 fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg"); | 179 fTextureRedSupport = version >= GR_GL_VER(3,0) || |
| 180 ctxInfo.hasExtension("GL_EXT_texture_rg"); |
| 179 } | 181 } |
| 180 | 182 |
| 181 fImagingSupport = kDesktop_GrGLBinding == binding && | 183 fImagingSupport = kDesktop_GrGLBinding == binding && |
| 182 ctxInfo.hasExtension("GL_ARB_imaging"); | 184 ctxInfo.hasExtension("GL_ARB_imaging"); |
| 183 | 185 |
| 184 // ES 2 only guarantees RGBA/uchar + one other format/type combo for | 186 // ES 2 only guarantees RGBA/uchar + one other format/type combo for |
| 185 // ReadPixels. The other format has to checked at run-time since it | 187 // ReadPixels. The other format has to checked at run-time since it |
| 186 // can change based on which render target is bound | 188 // can change based on which render target is bound |
| 187 fTwoFormatLimit = kES_GrGLBinding == binding; | 189 fTwoFormatLimit = kES_GrGLBinding == binding; |
| 188 | 190 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 596 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
| 595 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 597 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
| 596 GrPrintf("Fragment coord conventions support: %s\n", | 598 GrPrintf("Fragment coord conventions support: %s\n", |
| 597 (fFragCoordsConventionSupport ? "YES": "NO")); | 599 (fFragCoordsConventionSupport ? "YES": "NO")); |
| 598 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); | 600 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); |
| 599 GrPrintf("Use non-VBO for dynamic data: %s\n", | 601 GrPrintf("Use non-VBO for dynamic data: %s\n", |
| 600 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 602 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
| 601 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); | 603 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); |
| 602 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); | 604 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); |
| 603 } | 605 } |
| OLD | NEW |