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(); |
} |