| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |