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_
10 #include "base/basictypes.h"
11 #include "ui/gl/gl_export.h"
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
,
44 unsigned major_version
;
45 unsigned minor_version
;
47 bool is_desktop_core_profile
;
50 GLVersionInfo(const char* version_str
, const char* renderer_str
);
52 DISALLOW_COPY_AND_ASSIGN(GLVersionInfo
);
57 #endif // UI_GL_GL_VERSION_INFO_H_