Detect Mesa OpenGL ES

Original-Author: Henry Song <henrysong@samsung.com>

Review URL: https://codereview.chromium.org/700633002
This commit is contained in:
derekf 2014-11-03 13:36:40 -08:00 committed by Commit bot
parent 0537f290c5
commit a6ca5a002e

View File

@ -94,8 +94,18 @@ GrGLStandard GrGLGetStandardInUseFromString(const char* versionString) {
bool GrGLIsMesaFromVersionString(const char* versionString) {
int major, minor, mesaMajor, mesaMinor;
int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaMajor, &mesaMinor);
return 4 == n;
GrGLStandard standard = GrGLGetStandardInUseFromString(versionString);
if (standard == kGL_GrGLStandard) {
int n = sscanf(versionString, "%d.%d Mesa %d.%d", &major, &minor, &mesaMajor, &mesaMinor);
return 4 == n;
}
else {
int n = sscanf(versionString, "OpenGL ES %d.%d Mesa %d.%d", &major, &minor, &mesaMajor, &mesaMinor);
return 4 == n;
}
return false;
}
bool GrGLIsChromiumFromRendererString(const char* rendererString) {