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

Side by Side Diff: gpu/config/gpu_info_collector_android.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 | « gpu/config/gpu_info_collector.cc ('k') | gpu/config/gpu_info_collector_linux.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 "gpu/config/gpu_info_collector.h" 5 #include "gpu/config/gpu_info_collector.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 16 matching lines...) Expand all
27 begin = version_string.find_first_of("0123456789", begin); 27 begin = version_string.find_first_of("0123456789", begin);
28 if (begin == std::string::npos) 28 if (begin == std::string::npos)
29 return std::make_pair("", std::string::npos); 29 return std::make_pair("", std::string::npos);
30 30
31 size_t end = version_string.find_first_not_of("01234567890.", begin); 31 size_t end = version_string.find_first_not_of("01234567890.", begin);
32 std::string sub_string; 32 std::string sub_string;
33 if (end != std::string::npos) 33 if (end != std::string::npos)
34 sub_string = version_string.substr(begin, end - begin); 34 sub_string = version_string.substr(begin, end - begin);
35 else 35 else
36 sub_string = version_string.substr(begin); 36 sub_string = version_string.substr(begin);
37 std::vector<std::string> pieces; 37 std::vector<std::string> pieces = base::SplitString(
38 base::SplitString(sub_string, '.', &pieces); 38 sub_string, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
39 if (pieces.size() >= 2) 39 if (pieces.size() >= 2)
40 return std::make_pair(pieces[0] + "." + pieces[1], end); 40 return std::make_pair(pieces[0] + "." + pieces[1], end);
41 else 41 else
42 return std::make_pair("", end); 42 return std::make_pair("", end);
43 } 43 }
44 44
45 std::string GetDriverVersionFromString(const std::string& version_string) { 45 std::string GetDriverVersionFromString(const std::string& version_string) {
46 // We expect that android GL_VERSION strings will be of a form 46 // We expect that android GL_VERSION strings will be of a form
47 // similar to: "OpenGL ES 2.0 V@6.0 AU@ (CL@2946718)" where the 47 // similar to: "OpenGL ES 2.0 V@6.0 AU@ (CL@2946718)" where the
48 // first match to [0-9][0-9.]* is the OpenGL ES version number, and 48 // first match to [0-9][0-9.]* is the OpenGL ES version number, and
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 gpu_info->gpu.device_string = gpu_info->gl_renderer; 280 gpu_info->gpu.device_string = gpu_info->gl_renderer;
281 return kCollectInfoSuccess; 281 return kCollectInfoSuccess;
282 } 282 }
283 283
284 void MergeGPUInfo(GPUInfo* basic_gpu_info, 284 void MergeGPUInfo(GPUInfo* basic_gpu_info,
285 const GPUInfo& context_gpu_info) { 285 const GPUInfo& context_gpu_info) {
286 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); 286 MergeGPUInfoGL(basic_gpu_info, context_gpu_info);
287 } 287 }
288 288
289 } // namespace gpu 289 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/config/gpu_info_collector.cc ('k') | gpu/config/gpu_info_collector_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698