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

Side by Side Diff: src/gpu/gl/GrGLUtil.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 | « src/gpu/gl/GrGLUtil.h ('k') | no next file » | 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 2011 Google Inc. 2 * Copyright 2011 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 "GrGLUtil.h" 9 #include "GrGLUtil.h"
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 114 }
115 115
116 // check for ES2 116 // check for ES2
117 n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor); 117 n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor);
118 if (2 == n) { 118 if (2 == n) {
119 return kES2_GrGLBinding; 119 return kES2_GrGLBinding;
120 } 120 }
121 return kNone_GrGLBinding; 121 return kNone_GrGLBinding;
122 } 122 }
123 123
124 bool GrGLIsMesaFromVersionString(const char* versionString) {
125 int major, minor, mesaMajor, mesaMinor;
126 int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaMajor , &mesaMinor);
127 return 4 == n;
128 }
129
124 GrGLVersion GrGLGetVersionFromString(const char* versionString) { 130 GrGLVersion GrGLGetVersionFromString(const char* versionString) {
125 if (NULL == versionString) { 131 if (NULL == versionString) {
126 GrAssert(!"NULL GL version string."); 132 GrAssert(!"NULL GL version string.");
127 return 0; 133 return 0;
128 } 134 }
129 135
130 int major, minor; 136 int major, minor;
131 137
132 // check for mesa 138 // check for mesa
133 int mesaMajor, mesaMinor; 139 int mesaMajor, mesaMinor;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 const GrGLubyte* v; 226 const GrGLubyte* v;
221 GR_GL_CALL_RET(gl, v, GetString(GR_GL_SHADING_LANGUAGE_VERSION)); 227 GR_GL_CALL_RET(gl, v, GetString(GR_GL_SHADING_LANGUAGE_VERSION));
222 return GrGLGetGLSLVersionFromString((const char*) v); 228 return GrGLGetGLSLVersionFromString((const char*) v);
223 } 229 }
224 230
225 GrGLVendor GrGLGetVendor(const GrGLInterface* gl) { 231 GrGLVendor GrGLGetVendor(const GrGLInterface* gl) {
226 const GrGLubyte* v; 232 const GrGLubyte* v;
227 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VENDOR)); 233 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VENDOR));
228 return GrGLGetVendorFromString((const char*) v); 234 return GrGLGetVendorFromString((const char*) v);
229 } 235 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLUtil.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698