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: gpu/config/gpu_info_collector_android.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_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/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
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
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
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