OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_implementation.h" | 5 #include "ui/gl/gl_implementation.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 bool HasInitializedNullDrawGLBindings() { | 156 bool HasInitializedNullDrawGLBindings() { |
157 return HasInitializedNullDrawGLBindingsGL(); | 157 return HasInitializedNullDrawGLBindingsGL(); |
158 } | 158 } |
159 | 159 |
160 std::string FilterGLExtensionList( | 160 std::string FilterGLExtensionList( |
161 const char* extensions, | 161 const char* extensions, |
162 const std::vector<std::string>& disabled_extensions) { | 162 const std::vector<std::string>& disabled_extensions) { |
163 if (extensions == NULL) | 163 if (extensions == NULL) |
164 return ""; | 164 return ""; |
165 | 165 |
166 std::vector<std::string> extension_vec = base::SplitString( | 166 std::vector<std::string> extension_vec; |
167 extensions, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 167 base::SplitString(extensions, ' ', &extension_vec); |
168 | 168 |
169 auto is_disabled = [&disabled_extensions](const std::string& ext) { | 169 auto is_disabled = [&disabled_extensions](const std::string& ext) { |
170 return std::find(disabled_extensions.begin(), disabled_extensions.end(), | 170 return std::find(disabled_extensions.begin(), disabled_extensions.end(), |
171 ext) != disabled_extensions.end(); | 171 ext) != disabled_extensions.end(); |
172 }; | 172 }; |
173 extension_vec.erase( | 173 extension_vec.erase( |
174 std::remove_if(extension_vec.begin(), extension_vec.end(), is_disabled), | 174 std::remove_if(extension_vec.begin(), extension_vec.end(), is_disabled), |
175 extension_vec.end()); | 175 extension_vec.end()); |
176 | 176 |
177 return base::JoinString(extension_vec, " "); | 177 return base::JoinString(extension_vec, " "); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 const char* version_str = | 209 const char* version_str = |
210 reinterpret_cast<const char*>(glGetString(GL_VERSION)); | 210 reinterpret_cast<const char*>(glGetString(GL_VERSION)); |
211 unsigned major_version, minor_version; | 211 unsigned major_version, minor_version; |
212 bool is_es, is_es3; | 212 bool is_es, is_es3; |
213 gfx::GLVersionInfo::ParseVersionString( | 213 gfx::GLVersionInfo::ParseVersionString( |
214 version_str, &major_version, &minor_version, &is_es, &is_es3); | 214 version_str, &major_version, &minor_version, &is_es, &is_es3); |
215 return is_es || major_version < 3; | 215 return is_es || major_version < 3; |
216 } | 216 } |
217 | 217 |
218 } // namespace gfx | 218 } // namespace gfx |
OLD | NEW |