1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/gl/gl_version_info.h"
7 #include "base/strings/string_util.h"
11 GLVersionInfo::GLVersionInfo(const char* version_str
)
21 std::string
lstr(StringToLowerASCII(std::string(version_str
)));
22 is_es
= (lstr
.substr(0, 9) == "opengl es");
24 is_es1
= (lstr
.substr(9, 2) == "-c" && lstr
.substr(13, 2) == "1.");
25 is_es2
= (lstr
.substr(9, 3) == " 2.");
26 is_es3
= (lstr
.substr(9, 3) == " 3.");
28 is_gl2
= (lstr
.substr(0, 2) == "2.");
29 is_gl3
= (lstr
.substr(0, 2) == "3.");
30 is_gl4
= (lstr
.substr(0, 2) == "4.");
31 // In early GL versions, GetString output format is implementation
33 is_gl1
= !is_gl2
&& !is_gl3
&& !is_gl4
;