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 5978b2e6dfb49153fde49b2707a93bda7213a30f..be60a19413468e7bca9090760b360de78b511651 100644 |
--- a/content/common/gpu/gpu_channel_manager.cc |
+++ b/content/common/gpu/gpu_channel_manager.cc |
@@ -5,12 +5,17 @@ |
#include "content/common/gpu/gpu_channel_manager.h" |
#include "base/bind.h" |
+#include "base/command_line.h" |
#include "content/common/child_thread.h" |
#include "content/common/gpu/gpu_channel.h" |
#include "content/common/gpu/gpu_memory_manager.h" |
#include "content/common/gpu/gpu_messages.h" |
#include "content/common/gpu/sync_point_manager.h" |
+#include "gpu/command_buffer/service/feature_info.h" |
+#include "gpu/command_buffer/service/gpu_switches.h" |
#include "gpu/command_buffer/service/mailbox_manager.h" |
+#include "gpu/command_buffer/service/memory_program_cache.h" |
+#include "ui/gl/gl_bindings.h" |
#include "ui/gl/gl_share_group.h" |
GpuChannelManager::GpuChannelManager(ChildThread* gpu_child_thread, |
@@ -24,7 +29,8 @@ GpuChannelManager::GpuChannelManager(ChildThread* gpu_child_thread, |
ALLOW_THIS_IN_INITIALIZER_LIST(gpu_memory_manager_(this, |
GpuMemoryManager::kDefaultMaxSurfacesWithFrontbufferSoftLimit)), |
watchdog_(watchdog), |
- sync_point_manager_(new SyncPointManager) { |
+ sync_point_manager_(new SyncPointManager), |
+ program_cache_(NULL) { |
DCHECK(gpu_child_thread); |
DCHECK(io_message_loop); |
DCHECK(shutdown_event); |
@@ -34,6 +40,16 @@ GpuChannelManager::~GpuChannelManager() { |
gpu_channels_.clear(); |
} |
+gpu::gles2::ProgramCache* GpuChannelManager::program_cache() { |
+ if (!program_cache_.get() && |
+ (gfx::g_ARB_get_program_binary || gfx::g_OES_get_program_binary) && |
+ !CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kDisableGpuProgramCache)) { |
+ program_cache_.reset(new gpu::gles2::MemoryProgramCache()); |
+ } |
+ return program_cache_.get(); |
+} |
+ |
void GpuChannelManager::RemoveChannel(int client_id) { |
gpu_channels_.erase(client_id); |
} |
@@ -65,7 +81,6 @@ void GpuChannelManager::AppendAllCommandBufferStubs( |
it != gpu_channels_.end(); ++it ) { |
it->second->AppendAllCommandBufferStubs(stubs); |
} |
- |
} |
bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { |