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

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

Issue 1168153004: Limit number of raster threads on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 bool IsImplSidePaintingEnabled() { 192 bool IsImplSidePaintingEnabled() {
193 const base::CommandLine& command_line = 193 const base::CommandLine& command_line =
194 *base::CommandLine::ForCurrentProcess(); 194 *base::CommandLine::ForCurrentProcess();
195 if (command_line.HasSwitch(switches::kDisableImplSidePainting)) 195 if (command_line.HasSwitch(switches::kDisableImplSidePainting))
196 return false; 196 return false;
197 return true; 197 return true;
198 } 198 }
199 199
200 int NumberOfRendererRasterThreads() { 200 int NumberOfRendererRasterThreads() {
201 int num_raster_threads = base::SysInfo::NumberOfProcessors() / 2; 201 int num_processors = base::SysInfo::NumberOfProcessors();
202
203 #if defined(OS_ANDROID)
204 // Android may report 6 to 8 CPUs for big.LITTLE configurations.
205 // Limit the number of raster threads based on maximum of 4 big cores.
206 num_processors = std::min(num_processors, 4);
207 #endif
208
209 int num_raster_threads = num_processors / 2;
202 210
203 // Async uploads is used when neither zero-copy nor one-copy is enabled and 211 // Async uploads is used when neither zero-copy nor one-copy is enabled and
204 // it uses its own thread, so reduce the number of raster threads when async 212 // it uses its own thread, so reduce the number of raster threads when async
no sievers 2015/06/09 18:26:30 So what about this stuff? It sounds like it's talk
reveman 2015/06/09 19:28:13 Not needed in that case but it's hard to know that
205 // uploads is in use. 213 // uploads is in use.
206 bool async_uploads_is_used = 214 bool async_uploads_is_used =
207 !IsZeroCopyUploadEnabled() && !IsOneCopyUploadEnabled(); 215 !IsZeroCopyUploadEnabled() && !IsOneCopyUploadEnabled();
208 if (async_uploads_is_used) 216 if (async_uploads_is_used)
209 --num_raster_threads; 217 --num_raster_threads;
210 218
211 const base::CommandLine& command_line = 219 const base::CommandLine& command_line =
212 *base::CommandLine::ForCurrentProcess(); 220 *base::CommandLine::ForCurrentProcess();
213 221
214 if (command_line.HasSwitch(switches::kNumRasterThreads)) { 222 if (command_line.HasSwitch(switches::kNumRasterThreads)) {
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 437 }
430 } 438 }
431 return problem_list; 439 return problem_list;
432 } 440 }
433 441
434 std::vector<std::string> GetDriverBugWorkarounds() { 442 std::vector<std::string> GetDriverBugWorkarounds() {
435 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); 443 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds();
436 } 444 }
437 445
438 } // namespace content 446 } // 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