Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |