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

Unified Diff: content/browser/gpu/compositor_util.cc

Issue 2020243004: content: Rename num raster threads -> num worker threads. Base URL: https://chromium.googlesource.com/chromium/src.git@categorized_worker_pool_3
Patch Set: build break Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/compositor_util.cc
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 09018f7e4eb59a239ab9c775d858cabf77e88667..e8b60c6c1feea8c9c003c548765de556d86870df 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -35,7 +35,7 @@ static bool IsGpuRasterizationBlacklisted() {
const char kGpuCompositingFeatureName[] = "gpu_compositing";
const char kWebGLFeatureName[] = "webgl";
const char kRasterizationFeatureName[] = "rasterization";
-const char kMultipleRasterThreadsFeatureName[] = "multiple_raster_threads";
+const char kMultipleWorkerThreadsFeatureName[] = "multiple_worker_threads";
const char kNativeGpuMemoryBuffersFeatureName[] = "native_gpu_memory_buffers";
const int kMinRasterThreads = 1;
@@ -126,9 +126,9 @@ const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) {
"Accelerated rasterization has been disabled, either via blacklist,"
" about:flags or the command line.",
true},
- {kMultipleRasterThreadsFeatureName, false,
- NumberOfRendererRasterThreads() == 1, "Raster is using a single thread.",
- false},
+ {kMultipleWorkerThreadsFeatureName, false,
+ NumberOfRendererWorkerThreads() == 1,
+ "Worker pool is using a single thread.", false},
{kNativeGpuMemoryBuffersFeatureName, false,
!BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled(),
"Native GpuMemoryBuffers have been disabled, either via about:flags"
@@ -142,37 +142,37 @@ const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) {
} // namespace
-int NumberOfRendererRasterThreads() {
+int NumberOfRendererWorkerThreads() {
int num_processors = base::SysInfo::NumberOfProcessors();
#if defined(OS_ANDROID)
// Android may report 6 to 8 CPUs for big.LITTLE configurations.
- // Limit the number of raster threads based on maximum of 4 big cores.
+ // Limit the number of worker threads based on maximum of 4 big cores.
num_processors = std::min(num_processors, 4);
#endif
- int num_raster_threads = num_processors / 2;
+ int num_worker_threads = num_processors / 2;
#if defined(OS_ANDROID)
- // Limit the number of raster threads to 1 on Android.
- // TODO(reveman): Remove this when we have a better mechanims to prevent
+ // Limit the number of worker threads to 1 on Android.
+ // TODO(reveman): Remove this when we have a better mechanism to prevent
// pre-paint raster work from slowing down non-raster work. crbug.com/504515
- num_raster_threads = 1;
+ num_worker_threads = 1;
#endif
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kNumRasterThreads)) {
- std::string string_value = command_line.GetSwitchValueASCII(
- switches::kNumRasterThreads);
- if (!base::StringToInt(string_value, &num_raster_threads)) {
- DLOG(WARNING) << "Failed to parse switch " <<
- switches::kNumRasterThreads << ": " << string_value;
+ if (command_line.HasSwitch(switches::kNumWorkerThreads)) {
+ std::string string_value =
+ command_line.GetSwitchValueASCII(switches::kNumWorkerThreads);
+ if (!base::StringToInt(string_value, &num_worker_threads)) {
+ DLOG(WARNING) << "Failed to parse switch " << switches::kNumWorkerThreads
+ << ": " << string_value;
}
}
- return cc::MathUtil::ClampToRange(num_raster_threads, kMinRasterThreads,
+ return cc::MathUtil::ClampToRange(num_worker_threads, kMinRasterThreads,
kMaxRasterThreads);
}
@@ -333,13 +333,13 @@ base::DictionaryValue* GetFeatureStatus() {
if (IsForceGpuRasterizationEnabled())
status += "_force";
}
- if (gpu_feature_info.name == kMultipleRasterThreadsFeatureName) {
+ if (gpu_feature_info.name == kMultipleWorkerThreadsFeatureName) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kNumRasterThreads))
+ if (command_line.HasSwitch(switches::kNumWorkerThreads))
status += "_force";
}
- if (gpu_feature_info.name == kMultipleRasterThreadsFeatureName)
+ if (gpu_feature_info.name == kMultipleWorkerThreadsFeatureName)
status += "_on";
}
if (gpu_feature_info.name == kWebGLFeatureName &&

Powered by Google App Engine
This is Rietveld 408576698