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 "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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // Return a version string in the format of "major.minor". | 61 // Return a version string in the format of "major.minor". |
62 std::string GetVersionFromString(const std::string& version_string) { | 62 std::string GetVersionFromString(const std::string& version_string) { |
63 size_t begin = version_string.find_first_of("0123456789"); | 63 size_t begin = version_string.find_first_of("0123456789"); |
64 if (begin != std::string::npos) { | 64 if (begin != std::string::npos) { |
65 size_t end = version_string.find_first_not_of("01234567890.", begin); | 65 size_t end = version_string.find_first_not_of("01234567890.", begin); |
66 std::string sub_string; | 66 std::string sub_string; |
67 if (end != std::string::npos) | 67 if (end != std::string::npos) |
68 sub_string = version_string.substr(begin, end - begin); | 68 sub_string = version_string.substr(begin, end - begin); |
69 else | 69 else |
70 sub_string = version_string.substr(begin); | 70 sub_string = version_string.substr(begin); |
71 std::vector<std::string> pieces; | 71 std::vector<std::string> pieces = base::SplitString( |
72 base::SplitString(sub_string, '.', &pieces); | 72 sub_string, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
73 if (pieces.size() >= 2) | 73 if (pieces.size() >= 2) |
74 return pieces[0] + "." + pieces[1]; | 74 return pieces[0] + "." + pieces[1]; |
75 } | 75 } |
76 return std::string(); | 76 return std::string(); |
77 } | 77 } |
78 | 78 |
79 } // namespace anonymous | 79 } // namespace anonymous |
80 | 80 |
81 namespace gpu { | 81 namespace gpu { |
82 | 82 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 basic_gpu_info->video_decode_accelerator_supported_profiles = | 166 basic_gpu_info->video_decode_accelerator_supported_profiles = |
167 context_gpu_info.video_decode_accelerator_supported_profiles; | 167 context_gpu_info.video_decode_accelerator_supported_profiles; |
168 basic_gpu_info->video_encode_accelerator_supported_profiles = | 168 basic_gpu_info->video_encode_accelerator_supported_profiles = |
169 context_gpu_info.video_encode_accelerator_supported_profiles; | 169 context_gpu_info.video_encode_accelerator_supported_profiles; |
170 basic_gpu_info->jpeg_decode_accelerator_supported = | 170 basic_gpu_info->jpeg_decode_accelerator_supported = |
171 context_gpu_info.jpeg_decode_accelerator_supported; | 171 context_gpu_info.jpeg_decode_accelerator_supported; |
172 } | 172 } |
173 | 173 |
174 } // namespace gpu | 174 } // namespace gpu |
175 | 175 |
OLD | NEW |