Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 16955005: Add MESA detection to GrContextInfo and use to decide whether to use GL_ALPHA or GL_RED. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix comment type Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/gpu/gl/GrGLContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 fTextureUsageSupport = (kES2_GrGLBinding == binding) && 158 fTextureUsageSupport = (kES2_GrGLBinding == binding) &&
159 ctxInfo.hasExtension("GL_ANGLE_texture_usage"); 159 ctxInfo.hasExtension("GL_ANGLE_texture_usage");
160 160
161 // Tex storage is in desktop 4.2 and can be an extension to desktop or ES. 161 // Tex storage is in desktop 4.2 and can be an extension to desktop or ES.
162 fTexStorageSupport = (kDesktop_GrGLBinding == binding && 162 fTexStorageSupport = (kDesktop_GrGLBinding == binding &&
163 version >= GR_GL_VER(4,2)) || 163 version >= GR_GL_VER(4,2)) ||
164 ctxInfo.hasExtension("GL_ARB_texture_storage") || 164 ctxInfo.hasExtension("GL_ARB_texture_storage") ||
165 ctxInfo.hasExtension("GL_EXT_texture_storage"); 165 ctxInfo.hasExtension("GL_EXT_texture_storage");
166 166
167 // ARB_texture_rg is part of OpenGL 3.0 167 // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if
168 // it doesn't have ARB_texture_rg extension.
168 if (kDesktop_GrGLBinding == binding) { 169 if (kDesktop_GrGLBinding == binding) {
169 fTextureRedSupport = version >= GR_GL_VER(3,0) || 170 if (ctxInfo.isMesa()) {
170 ctxInfo.hasExtension("GL_ARB_texture_rg"); 171 fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg");
172 } else {
173 fTextureRedSupport = version >= GR_GL_VER(3,0) ||
174 ctxInfo.hasExtension("GL_ARB_texture_rg");
175 }
171 } else { 176 } else {
172 fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg"); 177 fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg");
173 } 178 }
174 179
175 fImagingSupport = kDesktop_GrGLBinding == binding && 180 fImagingSupport = kDesktop_GrGLBinding == binding &&
176 ctxInfo.hasExtension("GL_ARB_imaging"); 181 ctxInfo.hasExtension("GL_ARB_imaging");
177 182
178 // 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
179 // 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
180 // can change based on which render target is bound 185 // can change based on which render target is bound
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); 580 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO"));
576 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 581 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
577 GrPrintf("Fragment coord conventions support: %s\n", 582 GrPrintf("Fragment coord conventions support: %s\n",
578 (fFragCoordsConventionSupport ? "YES": "NO")); 583 (fFragCoordsConventionSupport ? "YES": "NO"));
579 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? " YES": "NO")); 584 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? " YES": "NO"));
580 GrPrintf("Use non-VBO for dynamic data: %s\n", 585 GrPrintf("Use non-VBO for dynamic data: %s\n",
581 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 586 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
582 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); 587 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO"));
583 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : " NO")); 588 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : " NO"));
584 } 589 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/GrGLContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698