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

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: rebase 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 int num_processors = base::SysInfo::NumberOfProcessors(); 181 int num_processors = base::SysInfo::NumberOfProcessors();
182 182
183 #if defined(OS_ANDROID) 183 #if defined(OS_ANDROID)
184 // Android may report 6 to 8 CPUs for big.LITTLE configurations. 184 // Android may report 6 to 8 CPUs for big.LITTLE configurations.
185 // Limit the number of raster threads based on maximum of 4 big cores. 185 // Limit the number of raster threads based on maximum of 4 big cores.
186 num_processors = std::min(num_processors, 4); 186 num_processors = std::min(num_processors, 4);
187 #endif 187 #endif
188 188
189 int num_raster_threads = num_processors / 2; 189 int num_raster_threads = num_processors / 2;
190 190
191 #if defined(OS_ANDROID)
192 // Limit the number of raster threads to 1 on Android.
193 // TODO(reveman): Remove this when we have a better mechanims to prevent
194 // pre-paint raster work from slowing down non-raster work. crbug.com/504515
195 num_raster_threads = 1;
196 #endif
197
198 const base::CommandLine& command_line = 191 const base::CommandLine& command_line =
199 *base::CommandLine::ForCurrentProcess(); 192 *base::CommandLine::ForCurrentProcess();
200 193
201 if (command_line.HasSwitch(switches::kNumRasterThreads)) { 194 if (command_line.HasSwitch(switches::kNumRasterThreads)) {
202 std::string string_value = command_line.GetSwitchValueASCII( 195 std::string string_value = command_line.GetSwitchValueASCII(
203 switches::kNumRasterThreads); 196 switches::kNumRasterThreads);
204 if (!base::StringToInt(string_value, &num_raster_threads)) { 197 if (!base::StringToInt(string_value, &num_raster_threads)) {
205 DLOG(WARNING) << "Failed to parse switch " << 198 DLOG(WARNING) << "Failed to parse switch " <<
206 switches::kNumRasterThreads << ": " << string_value; 199 switches::kNumRasterThreads << ": " << string_value;
207 } 200 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 } 398 }
406 } 399 }
407 return problem_list; 400 return problem_list;
408 } 401 }
409 402
410 std::vector<std::string> GetDriverBugWorkarounds() { 403 std::vector<std::string> GetDriverBugWorkarounds() {
411 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); 404 return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds();
412 } 405 }
413 406
414 } // namespace content 407 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698