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

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

Issue 10534173: GPU Program Caching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: tiny fix for android and windows build Created 8 years, 5 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 5978b2e6dfb49153fde49b2707a93bda7213a30f..cd6c5db9a662f99236229a5a6ecbf4b1614d7d29 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -5,12 +5,16 @@
#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/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 +28,13 @@ 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_(
+ gfx::g_glProgramBinary &&
+ gfx::g_glGetProgramBinary &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGpuProgramCache) ?
+ new gpu::gles2::MemoryProgramCache() : NULL) {
DCHECK(gpu_child_thread);
DCHECK(io_message_loop);
DCHECK(shutdown_event);
@@ -65,7 +75,6 @@ void GpuChannelManager::AppendAllCommandBufferStubs(
it != gpu_channels_.end(); ++it ) {
it->second->AppendAllCommandBufferStubs(stubs);
}
-
}
bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) {
@@ -105,7 +114,8 @@ void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) {
share_group,
mailbox_manager,
client_id,
- false);
+ false,
+ program_cache_.get());
if (channel->Init(io_message_loop_, shutdown_event_)) {
gpu_channels_[client_id] = channel;
channel_handle.name = channel->GetChannelName();

Powered by Google App Engine
This is Rietveld 408576698