| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | |
| 10 #include <string> | 9 #include <string> |
| 11 | 10 |
| 12 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
| 13 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 13 #include "base/logging.h" |
| 15 #include "base/macros.h" | 14 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "base/stl_util.h" |
| 17 #include "base/strings/string_piece.h" | 17 #include "base/strings/string_piece.h" |
| 18 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
| 19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "ui/gl/gl_bindings.h" | 21 #include "ui/gl/gl_bindings.h" |
| 22 #include "ui/gl/gl_gl_api_implementation.h" | 22 #include "ui/gl/gl_gl_api_implementation.h" |
| 23 #include "ui/gl/gl_version_info.h" | 23 #include "ui/gl/gl_version_info.h" |
| 24 | 24 |
| 25 namespace gl { | 25 namespace gl { |
| 26 | 26 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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<base::StringPiece> extension_vec = base::SplitStringPiece( | 166 std::vector<base::StringPiece> extension_vec = base::SplitStringPiece( |
| 167 extensions, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 167 extensions, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 168 | 168 |
| 169 auto is_disabled = [&disabled_extensions](const base::StringPiece& ext) { | 169 auto is_disabled = [&disabled_extensions](const base::StringPiece& ext) { |
| 170 return std::find(disabled_extensions.begin(), disabled_extensions.end(), | 170 return base::ContainsValue(disabled_extensions, ext); |
| 171 ext) != disabled_extensions.end(); | |
| 172 }; | 171 }; |
| 173 extension_vec.erase( | 172 extension_vec.erase( |
| 174 std::remove_if(extension_vec.begin(), extension_vec.end(), is_disabled), | 173 std::remove_if(extension_vec.begin(), extension_vec.end(), is_disabled), |
| 175 extension_vec.end()); | 174 extension_vec.end()); |
| 176 | 175 |
| 177 return base::JoinString(extension_vec, " "); | 176 return base::JoinString(extension_vec, " "); |
| 178 } | 177 } |
| 179 | 178 |
| 180 DisableNullDrawGLBindings::DisableNullDrawGLBindings() { | 179 DisableNullDrawGLBindings::DisableNullDrawGLBindings() { |
| 181 initial_enabled_ = SetNullDrawGLBindingsEnabled(false); | 180 initial_enabled_ = SetNullDrawGLBindingsEnabled(false); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 base::NativeLibrary library = base::LoadNativeLibrary(filename, &error); | 243 base::NativeLibrary library = base::LoadNativeLibrary(filename, &error); |
| 245 if (!library) { | 244 if (!library) { |
| 246 LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " | 245 LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " |
| 247 << error.ToString(); | 246 << error.ToString(); |
| 248 return NULL; | 247 return NULL; |
| 249 } | 248 } |
| 250 return library; | 249 return library; |
| 251 } | 250 } |
| 252 | 251 |
| 253 } // namespace gl | 252 } // namespace gl |
| OLD | NEW |