From a6ca5a002ee62a1a6b146111cd9bc3f0c4891122 Mon Sep 17 00:00:00 2001 From: derekf Date: Mon, 3 Nov 2014 13:36:40 -0800 Subject: [PATCH] Detect Mesa OpenGL ES Original-Author: Henry Song Review URL: https://codereview.chromium.org/700633002 --- src/gpu/gl/GrGLUtil.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp index e6ebb2b653..96e26c7826 100644 --- a/src/gpu/gl/GrGLUtil.cpp +++ b/src/gpu/gl/GrGLUtil.cpp @@ -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) { -- 2.34.1