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

Side by Side Diff: gpu/config/gpu_info_collector.cc

Issue 2022983003: Roll base to 5e00da80f6adb7082d1c0e88d3274cf87cc43bc5 and tonic to f7acabb8fa6c91124486a41194eac3cd… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 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_control_list.cc ('k') | gpu/config/gpu_info_collector_android.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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // Return a version string in the format of "major.minor". 62 // Return a version string in the format of "major.minor".
63 std::string GetVersionFromString(const std::string& version_string) { 63 std::string GetVersionFromString(const std::string& version_string) {
64 size_t begin = version_string.find_first_of("0123456789"); 64 size_t begin = version_string.find_first_of("0123456789");
65 if (begin != std::string::npos) { 65 if (begin != std::string::npos) {
66 size_t end = version_string.find_first_not_of("01234567890.", begin); 66 size_t end = version_string.find_first_not_of("01234567890.", begin);
67 std::string sub_string; 67 std::string sub_string;
68 if (end != std::string::npos) 68 if (end != std::string::npos)
69 sub_string = version_string.substr(begin, end - begin); 69 sub_string = version_string.substr(begin, end - begin);
70 else 70 else
71 sub_string = version_string.substr(begin); 71 sub_string = version_string.substr(begin);
72 std::vector<std::string> pieces; 72 std::vector<std::string> pieces = base::SplitString(
73 base::SplitString(sub_string, '.', &pieces); 73 sub_string, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
74 if (pieces.size() >= 2) 74 if (pieces.size() >= 2)
75 return pieces[0] + "." + pieces[1]; 75 return pieces[0] + "." + pieces[1];
76 } 76 }
77 return std::string(); 77 return std::string();
78 } 78 }
79 79
80 } // namespace anonymous 80 } // namespace anonymous
81 81
82 namespace gpu { 82 namespace gpu {
83 83
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 basic_gpu_info->sandboxed = context_gpu_info.sandboxed; 157 basic_gpu_info->sandboxed = context_gpu_info.sandboxed;
158 basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering; 158 basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering;
159 basic_gpu_info->context_info_state = context_gpu_info.context_info_state; 159 basic_gpu_info->context_info_state = context_gpu_info.context_info_state;
160 basic_gpu_info->initialization_time = context_gpu_info.initialization_time; 160 basic_gpu_info->initialization_time = context_gpu_info.initialization_time;
161 basic_gpu_info->video_encode_accelerator_supported_profiles = 161 basic_gpu_info->video_encode_accelerator_supported_profiles =
162 context_gpu_info.video_encode_accelerator_supported_profiles; 162 context_gpu_info.video_encode_accelerator_supported_profiles;
163 } 163 }
164 164
165 } // namespace gpu 165 } // namespace gpu
166 166
OLDNEW
« no previous file with comments | « gpu/config/gpu_control_list.cc ('k') | gpu/config/gpu_info_collector_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698