Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: ui/gl/gl_implementation.cc

Issue 1274123003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no media changes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_gl_api_implementation.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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; 166 std::vector<std::string> extension_vec = base::SplitString(
167 base::SplitString(extensions, ' ', &extension_vec); 167 extensions, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
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
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
OLDNEW
« no previous file with comments | « ui/gl/gl_gl_api_implementation.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698