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

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

Issue 1616953003: content: Improve thread priority for raster threads. (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
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 } // namespace 163 } // namespace
164 164
165 bool IsPropertyTreeVerificationEnabled() { 165 bool IsPropertyTreeVerificationEnabled() {
166 const base::CommandLine& command_line = 166 const base::CommandLine& command_line =
167 *base::CommandLine::ForCurrentProcess(); 167 *base::CommandLine::ForCurrentProcess();
168 return command_line.HasSwitch(cc::switches::kEnablePropertyTreeVerification); 168 return command_line.HasSwitch(cc::switches::kEnablePropertyTreeVerification);
169 } 169 }
170 170
171 int NumberOfRendererRasterThreads() { 171 int NumberOfRendererRasterThreads() {
172 int num_processors = base::SysInfo::NumberOfProcessors(); 172 int num_raster_threads = base::SysInfo::NumberOfProcessors() / 2;
173 173
174 #if defined(OS_ANDROID) 174 #if defined(OS_ANDROID)
175 // Android may report 6 to 8 CPUs for big.LITTLE configurations. 175 // Use one thread for foreground raster work on Android.
176 // Limit the number of raster threads based on maximum of 4 big cores.
177 num_processors = std::min(num_processors, 4);
178 #endif
179
180 int num_raster_threads = num_processors / 2;
181
182 #if defined(OS_ANDROID)
183 // Limit the number of raster threads to 1 on Android.
184 // TODO(reveman): Remove this when we have a better mechanims to prevent
185 // pre-paint raster work from slowing down non-raster work. crbug.com/504515
186 num_raster_threads = 1; 176 num_raster_threads = 1;
187 #endif 177 #endif
188 178
189 const base::CommandLine& command_line = 179 const base::CommandLine& command_line =
190 *base::CommandLine::ForCurrentProcess(); 180 *base::CommandLine::ForCurrentProcess();
191 181
192 if (command_line.HasSwitch(switches::kNumRasterThreads)) { 182 if (command_line.HasSwitch(switches::kNumRasterThreads)) {
193 std::string string_value = command_line.GetSwitchValueASCII( 183 std::string string_value = command_line.GetSwitchValueASCII(
194 switches::kNumRasterThreads); 184 switches::kNumRasterThreads);
195 if (!base::StringToInt(string_value, &num_raster_threads)) { 185 if (!base::StringToInt(string_value, &num_raster_threads)) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 386 }
397 } 387 }
398 return problem_list; 388 return problem_list;
399 } 389 }
400 390
401 std::vector<std::string> GetDriverBugWorkarounds() { 391 std::vector<std::string> GetDriverBugWorkarounds() {
402 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); 392 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds();
403 } 393 }
404 394
405 } // namespace content 395 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698