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

Unified Diff: content/common/gpu/gpu_channel_manager.cc

Issue 1716813002: Use GpuPreferences to avoid directly accessing switches in gpu related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gpu_channel_manager.cc
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index d5ffd601afedeadd12b1b645ce6f368e19f08916..74b108e5f0e810eefcbcf4d66f4742cf07b90c79 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -52,6 +52,7 @@ const int kMaxKeepAliveTimeMs = 200;
}
GpuChannelManager::GpuChannelManager(
+ const gpu::GpuPreferences& gpu_preferences,
GpuChannelManagerDelegate* delegate,
GpuWatchdog* watchdog,
base::SingleThreadTaskRunner* task_runner,
@@ -61,11 +62,12 @@ GpuChannelManager::GpuChannelManager(
GpuMemoryBufferFactory* gpu_memory_buffer_factory)
: task_runner_(task_runner),
io_task_runner_(io_task_runner),
+ gpu_preferences_(gpu_preferences),
delegate_(delegate),
watchdog_(watchdog),
shutdown_event_(shutdown_event),
share_group_(new gfx::GLShareGroup),
- mailbox_manager_(gpu::gles2::MailboxManager::Create()),
+ mailbox_manager_(gpu::gles2::MailboxManager::Create(gpu_preferences)),
gpu_memory_manager_(this),
sync_point_manager_(sync_point_manager),
sync_point_client_waiter_(
@@ -95,15 +97,19 @@ gpu::gles2::ProgramCache* GpuChannelManager::program_cache() {
gfx::g_driver_gl.ext.b_GL_OES_get_program_binary) &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableGpuProgramCache)) {
- program_cache_.reset(new gpu::gles2::MemoryProgramCache());
+ program_cache_.reset(new gpu::gles2::MemoryProgramCache(
+ gpu_preferences_.gpu_program_cache_size,
+ gpu_preferences_.disable_gpu_shader_disk_cache));
}
return program_cache_.get();
}
gpu::gles2::ShaderTranslatorCache*
GpuChannelManager::shader_translator_cache() {
- if (!shader_translator_cache_.get())
- shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache;
+ if (!shader_translator_cache_.get()) {
+ shader_translator_cache_ =
+ new gpu::gles2::ShaderTranslatorCache(gpu_preferences_);
+ }
return shader_translator_cache_.get();
}

Powered by Google App Engine
This is Rietveld 408576698