| 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 #include "ui/gl/gl_version_info.h" | 5 #include "ui/gl/gl_version_info.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/string_tokenizer.h" | 8 #include "base/strings/string_tokenizer.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 bool DesktopCoreCommonCheck( | 13 bool DesktopCoreCommonCheck( |
| 14 bool is_es, unsigned major_version, unsigned minor_version) { | 14 bool is_es, unsigned major_version, unsigned minor_version) { |
| 15 return (!is_es && | 15 return (!is_es && |
| 16 ((major_version == 3 && minor_version >= 2) || | 16 ((major_version == 3 && minor_version >= 2) || |
| 17 major_version > 3)); | 17 major_version > 3)); |
| 18 } | 18 } |
| 19 | 19 |
| 20 } | 20 } |
| 21 | 21 |
| 22 | 22 namespace gl { |
| 23 namespace gfx { | |
| 24 | 23 |
| 25 GLVersionInfo::GLVersionInfo(const char* version_str, const char* renderer_str, | 24 GLVersionInfo::GLVersionInfo(const char* version_str, const char* renderer_str, |
| 26 const char* extensions_str) | 25 const char* extensions_str) |
| 27 : GLVersionInfo(version_str, renderer_str) { | 26 : GLVersionInfo(version_str, renderer_str) { |
| 28 is_desktop_core_profile = | 27 is_desktop_core_profile = |
| 29 DesktopCoreCommonCheck(is_es, major_version, minor_version) && | 28 DesktopCoreCommonCheck(is_es, major_version, minor_version) && |
| 30 !strstr(extensions_str, "GL_ARB_compatibility"); | 29 !strstr(extensions_str, "GL_ARB_compatibility"); |
| 31 } | 30 } |
| 32 | 31 |
| 33 GLVersionInfo::GLVersionInfo(const char* version_str, const char* renderer_str, | 32 GLVersionInfo::GLVersionInfo(const char* version_str, const char* renderer_str, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 *minor_version = minor; | 83 *minor_version = minor; |
| 85 } | 84 } |
| 86 } | 85 } |
| 87 if (*is_es && *major_version == 2) | 86 if (*is_es && *major_version == 2) |
| 88 *is_es2 = true; | 87 *is_es2 = true; |
| 89 if (*is_es && *major_version == 3) | 88 if (*is_es && *major_version == 3) |
| 90 *is_es3 = true; | 89 *is_es3 = true; |
| 91 DCHECK(major_version != 0); | 90 DCHECK(major_version != 0); |
| 92 } | 91 } |
| 93 | 92 |
| 94 } // namespace gfx | 93 } // namespace gl |
| OLD | NEW |