| 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 "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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // Extract number of the form "%d.%d" | 30 // Extract number of the form "%d.%d" |
| 31 begin = version_string.find_first_of("0123456789", end); | 31 begin = version_string.find_first_of("0123456789", end); |
| 32 if (begin == std::string::npos) | 32 if (begin == std::string::npos) |
| 33 return "0"; | 33 return "0"; |
| 34 end = version_string.find_first_not_of("01234567890.", begin); | 34 end = version_string.find_first_not_of("01234567890.", begin); |
| 35 std::string sub_string; | 35 std::string sub_string; |
| 36 if (end != std::string::npos) | 36 if (end != std::string::npos) |
| 37 sub_string = version_string.substr(begin, end - begin); | 37 sub_string = version_string.substr(begin, end - begin); |
| 38 else | 38 else |
| 39 sub_string = version_string.substr(begin); | 39 sub_string = version_string.substr(begin); |
| 40 std::vector<std::string> pieces; | 40 std::vector<std::string> pieces = base::SplitString( |
| 41 base::SplitString(sub_string, '.', &pieces); | 41 sub_string, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 42 if (pieces.size() < 2) | 42 if (pieces.size() < 2) |
| 43 return "0"; | 43 return "0"; |
| 44 return pieces[0] + "." + pieces[1]; | 44 return pieces[0] + "." + pieces[1]; |
| 45 } | 45 } |
| 46 | 46 |
| 47 class ScopedRestoreNonOwnedEGLContext { | 47 class ScopedRestoreNonOwnedEGLContext { |
| 48 public: | 48 public: |
| 49 ScopedRestoreNonOwnedEGLContext(); | 49 ScopedRestoreNonOwnedEGLContext(); |
| 50 ~ScopedRestoreNonOwnedEGLContext(); | 50 ~ScopedRestoreNonOwnedEGLContext(); |
| 51 | 51 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 gpu_info->gpu.device_string = gpu_info->gl_renderer; | 117 gpu_info->gpu.device_string = gpu_info->gl_renderer; |
| 118 return kCollectInfoSuccess; | 118 return kCollectInfoSuccess; |
| 119 } | 119 } |
| 120 | 120 |
| 121 void MergeGPUInfo(GPUInfo* basic_gpu_info, | 121 void MergeGPUInfo(GPUInfo* basic_gpu_info, |
| 122 const GPUInfo& context_gpu_info) { | 122 const GPUInfo& context_gpu_info) { |
| 123 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 123 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace gpu | 126 } // namespace gpu |
| OLD | NEW |