Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: ui/gl/gl_version_info.h

Issue 1106833002: Emulate GL_PRIMITIVE_RESTART_FIXED_INDEX: part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GL_GL_VERSION_INFO_H_ 5 #ifndef UI_GL_GL_VERSION_INFO_H_
6 #define UI_GL_GL_VERSION_INFO_H_ 6 #define UI_GL_GL_VERSION_INFO_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "ui/gl/gl_export.h" 11 #include "ui/gl/gl_export.h"
12 12
13 namespace gfx { 13 namespace gfx {
14 14
15 struct GL_EXPORT GLVersionInfo { 15 struct GL_EXPORT GLVersionInfo {
16 GLVersionInfo(const char* version_str, const char* renderer_str, 16 GLVersionInfo(const char* version_str, const char* renderer_str,
17 const char* extensions_str); 17 const char* extensions_str);
18 18
19 GLVersionInfo(const char* version_str, const char* renderer_str, 19 GLVersionInfo(const char* version_str, const char* renderer_str,
20 const std::set<std::string>& exts); 20 const std::set<std::string>& exts);
21 21
22 bool IsAtLeastGL(unsigned major, unsigned minor) const { 22 bool IsAtLeastGL(unsigned major, unsigned minor) const {
23 return !is_es && (major_version > major || 23 return !is_es && (major_version > major ||
24 (major_version == major && minor_version >= minor)); 24 (major_version == major && minor_version >= minor));
25 } 25 }
26 26
27 bool IsLowerThanGL(unsigned major, unsigned minor) const {
28 return !is_es && (major_version < major ||
29 (major_version == major && minor_version < minor));
30 }
31
27 bool IsAtLeastGLES(unsigned major, unsigned minor) const { 32 bool IsAtLeastGLES(unsigned major, unsigned minor) const {
28 return is_es && (major_version > major || 33 return is_es && (major_version > major ||
29 (major_version == major && minor_version >= minor)); 34 (major_version == major && minor_version >= minor));
30 } 35 }
31 36
32 bool BehavesLikeGLES() const { 37 bool BehavesLikeGLES() const {
33 return is_es || is_desktop_core_profile; 38 return is_es || is_desktop_core_profile;
34 } 39 }
35 40
36 static void ParseVersionString(const char* version_str, 41 static void ParseVersionString(const char* version_str,
(...skipping 11 matching lines...) Expand all
48 53
49 private: 54 private:
50 GLVersionInfo(const char* version_str, const char* renderer_str); 55 GLVersionInfo(const char* version_str, const char* renderer_str);
51 56
52 DISALLOW_COPY_AND_ASSIGN(GLVersionInfo); 57 DISALLOW_COPY_AND_ASSIGN(GLVersionInfo);
53 }; 58 };
54 59
55 } // namespace gfx 60 } // namespace gfx
56 61
57 #endif // UI_GL_GL_VERSION_INFO_H_ 62 #endif // UI_GL_GL_VERSION_INFO_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698