| OLD | NEW |
| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 char profile[2]; | 109 char profile[2]; |
| 110 n = sscanf(versionString, "OpenGL ES-%c%c %d.%d", profile, profile+1, &major
, &minor); | 110 n = sscanf(versionString, "OpenGL ES-%c%c %d.%d", profile, profile+1, &major
, &minor); |
| 111 if (4 == n) { | 111 if (4 == n) { |
| 112 // we no longer support ES1. | 112 // we no longer support ES1. |
| 113 return kNone_GrGLBinding; | 113 return kNone_GrGLBinding; |
| 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 kES_GrGLBinding; |
| 120 } | 120 } |
| 121 return kNone_GrGLBinding; | 121 return kNone_GrGLBinding; |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool GrGLIsMesaFromVersionString(const char* versionString) { | 124 bool GrGLIsMesaFromVersionString(const char* versionString) { |
| 125 int major, minor, mesaMajor, mesaMinor; | 125 int major, minor, mesaMajor, mesaMinor; |
| 126 int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaMajor
, &mesaMinor); | 126 int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaMajor
, &mesaMinor); |
| 127 return 4 == n; | 127 return 4 == n; |
| 128 } | 128 } |
| 129 | 129 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 const GrGLubyte* v; | 226 const GrGLubyte* v; |
| 227 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)); |
| 228 return GrGLGetGLSLVersionFromString((const char*) v); | 228 return GrGLGetGLSLVersionFromString((const char*) v); |
| 229 } | 229 } |
| 230 | 230 |
| 231 GrGLVendor GrGLGetVendor(const GrGLInterface* gl) { | 231 GrGLVendor GrGLGetVendor(const GrGLInterface* gl) { |
| 232 const GrGLubyte* v; | 232 const GrGLubyte* v; |
| 233 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VENDOR)); | 233 GR_GL_CALL_RET(gl, v, GetString(GR_GL_VENDOR)); |
| 234 return GrGLGetVendorFromString((const char*) v); | 234 return GrGLGetVendorFromString((const char*) v); |
| 235 } | 235 } |
| OLD | NEW |