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

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

Issue 700633002: Detect Mesa OpenGL ES (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | 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 #include "SkMatrix.h" 10 #include "SkMatrix.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // check for ES2 87 // check for ES2
88 n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor); 88 n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor);
89 if (2 == n) { 89 if (2 == n) {
90 return kGLES_GrGLStandard; 90 return kGLES_GrGLStandard;
91 } 91 }
92 return kNone_GrGLStandard; 92 return kNone_GrGLStandard;
93 } 93 }
94 94
95 bool GrGLIsMesaFromVersionString(const char* versionString) { 95 bool GrGLIsMesaFromVersionString(const char* versionString) {
96 int major, minor, mesaMajor, mesaMinor; 96 int major, minor, mesaMajor, mesaMinor;
97 int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaMajor , &mesaMinor); 97
98 return 4 == n; 98 GrGLStandard standard = GrGLGetStandardInUseFromString(versionString);
99
100 if (standard == kGL_GrGLStandard) {
101 int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaM ajor, &mesaMinor);
102 return 4 == n;
103 }
104 else {
105 int n = sscanf(versionString, "OpenGL ES %d.%d Mesa %d.%d", &major, &min or, &mesaMajor, &mesaMinor);
106 return 4 == n;
107 }
108 return false;
99 } 109 }
100 110
101 bool GrGLIsChromiumFromRendererString(const char* rendererString) { 111 bool GrGLIsChromiumFromRendererString(const char* rendererString) {
102 return 0 == strcmp(rendererString, "Chromium"); 112 return 0 == strcmp(rendererString, "Chromium");
103 } 113 }
104 114
105 GrGLVersion GrGLGetVersionFromString(const char* versionString) { 115 GrGLVersion GrGLGetVersionFromString(const char* versionString) {
106 if (NULL == versionString) { 116 if (NULL == versionString) {
107 SkDebugf("NULL GL version string."); 117 SkDebugf("NULL GL version string.");
108 return GR_GL_INVALID_VER; 118 return GR_GL_INVALID_VER;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); 292 GR_STATIC_ASSERT(2 == kGreater_StencilFunc);
283 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); 293 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc);
284 GR_STATIC_ASSERT(4 == kLess_StencilFunc); 294 GR_STATIC_ASSERT(4 == kLess_StencilFunc);
285 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); 295 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc);
286 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); 296 GR_STATIC_ASSERT(6 == kEqual_StencilFunc);
287 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); 297 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc);
288 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); 298 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount);
289 299
290 return gTable[basicFunc]; 300 return gTable[basicFunc];
291 } 301 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698