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

Side by Side Diff: content/browser/gpu/compositor_util.cc

Issue 1733703002: content: Allow multiple raster threads on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | 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 "content/browser/gpu/compositor_util.h" 5 #include "content/browser/gpu/compositor_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 171
172 } // namespace 172 } // namespace
173 173
174 int NumberOfRendererRasterThreads() { 174 int NumberOfRendererRasterThreads() {
175 int num_processors = base::SysInfo::NumberOfProcessors(); 175 int num_processors = base::SysInfo::NumberOfProcessors();
176 176
177 #if defined(OS_ANDROID) 177 #if defined(OS_ANDROID)
178 // Android may report 6 to 8 CPUs for big.LITTLE configurations. 178 // Android may report 6 to 8 CPUs for big.LITTLE configurations.
179 // Limit the number of raster threads based on maximum of 4 big cores. 179 // Limit the number of raster threads based on maximum of 4 big cores.
180 num_processors = std::min(num_processors, 4); 180 num_processors = std::min(num_processors, 4);
aelias_OOO_until_Jul13 2016/02/26 03:12:03 How about moving this to the base::SysInfo::Number
181 #endif 181 #endif
182 182
183 int num_raster_threads = num_processors / 2; 183 int num_raster_threads = num_processors / 2;
184 184
185 #if defined(OS_ANDROID)
186 // Limit the number of raster threads to 1 on Android.
187 // TODO(reveman): Remove this when we have a better mechanims to prevent
188 // pre-paint raster work from slowing down non-raster work. crbug.com/504515
189 num_raster_threads = 1;
aelias_OOO_until_Jul13 2016/02/26 03:12:02 vmpstr@ and ericrk@ mentioned today they'd also pr
190 #endif
191
192 const base::CommandLine& command_line = 185 const base::CommandLine& command_line =
193 *base::CommandLine::ForCurrentProcess(); 186 *base::CommandLine::ForCurrentProcess();
194 187
195 if (command_line.HasSwitch(switches::kNumRasterThreads)) { 188 if (command_line.HasSwitch(switches::kNumRasterThreads)) {
196 std::string string_value = command_line.GetSwitchValueASCII( 189 std::string string_value = command_line.GetSwitchValueASCII(
197 switches::kNumRasterThreads); 190 switches::kNumRasterThreads);
198 if (!base::StringToInt(string_value, &num_raster_threads)) { 191 if (!base::StringToInt(string_value, &num_raster_threads)) {
199 DLOG(WARNING) << "Failed to parse switch " << 192 DLOG(WARNING) << "Failed to parse switch " <<
200 switches::kNumRasterThreads << ": " << string_value; 193 switches::kNumRasterThreads << ": " << string_value;
201 } 194 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } 392 }
400 } 393 }
401 return problem_list; 394 return problem_list;
402 } 395 }
403 396
404 std::vector<std::string> GetDriverBugWorkarounds() { 397 std::vector<std::string> GetDriverBugWorkarounds() {
405 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); 398 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds();
406 } 399 }
407 400
408 } // namespace content 401 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698