Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / gl / gl_version_info.h
blob1bfca2014ecd9db7290c41434ad158a3222307df
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 #ifndef UI_GL_GL_VERSION_INFO_H_
6 #define UI_GL_GL_VERSION_INFO_H_
8 #include <set>
9 #include <string>
10 #include "base/basictypes.h"
11 #include "ui/gl/gl_export.h"
13 namespace gfx {
15 struct GL_EXPORT GLVersionInfo {
16 GLVersionInfo(const char* version_str, const char* renderer_str,
17 const char* extensions_str);
19 GLVersionInfo(const char* version_str, const char* renderer_str,
20 const std::set<std::string>& exts);
22 bool IsAtLeastGL(unsigned major, unsigned minor) const {
23 return !is_es && (major_version > major ||
24 (major_version == major && minor_version >= minor));
27 bool IsAtLeastGLES(unsigned major, unsigned minor) const {
28 return is_es && (major_version > major ||
29 (major_version == major && minor_version >= minor));
32 bool BehavesLikeGLES() const {
33 return is_es || is_desktop_core_profile;
36 static void ParseVersionString(const char* version_str,
37 unsigned* major_version,
38 unsigned* minor_version,
39 bool* is_es,
40 bool* is_es3);
42 bool is_es;
43 bool is_angle;
44 unsigned major_version;
45 unsigned minor_version;
46 bool is_es3;
47 bool is_desktop_core_profile;
49 private:
50 GLVersionInfo(const char* version_str, const char* renderer_str);
52 DISALLOW_COPY_AND_ASSIGN(GLVersionInfo);
55 } // namespace gfx
57 #endif // UI_GL_GL_VERSION_INFO_H_