| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 is_angle(false), | 43 is_angle(false), |
| 44 major_version(0), | 44 major_version(0), |
| 45 minor_version(0), | 45 minor_version(0), |
| 46 is_es3(false), | 46 is_es3(false), |
| 47 is_desktop_core_profile(false) { | 47 is_desktop_core_profile(false) { |
| 48 if (version_str) { | 48 if (version_str) { |
| 49 ParseVersionString(version_str, &major_version, &minor_version, | 49 ParseVersionString(version_str, &major_version, &minor_version, |
| 50 &is_es, &is_es3); | 50 &is_es, &is_es3); |
| 51 } | 51 } |
| 52 if (renderer_str) { | 52 if (renderer_str) { |
| 53 is_angle = StartsWithASCII(renderer_str, "ANGLE", true); | 53 is_angle = base::StartsWithASCII(renderer_str, "ANGLE", true); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 void GLVersionInfo::ParseVersionString(const char* version_str, | 57 void GLVersionInfo::ParseVersionString(const char* version_str, |
| 58 unsigned* major_version, | 58 unsigned* major_version, |
| 59 unsigned* minor_version, | 59 unsigned* minor_version, |
| 60 bool* is_es, | 60 bool* is_es, |
| 61 bool* is_es3) { | 61 bool* is_es3) { |
| 62 // Make sure the outputs are always initialized. | 62 // Make sure the outputs are always initialized. |
| 63 *major_version = 0; | 63 *major_version = 0; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 78 if (tokenizer.GetNext() && | 78 if (tokenizer.GetNext() && |
| 79 base::StringToUint(tokenizer.token_piece(), &minor)) { | 79 base::StringToUint(tokenizer.token_piece(), &minor)) { |
| 80 *minor_version = minor; | 80 *minor_version = minor; |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 if (*is_es && *major_version == 3) | 83 if (*is_es && *major_version == 3) |
| 84 *is_es3 = true; | 84 *is_es3 = true; |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace gfx | 87 } // namespace gfx |
| OLD | NEW |