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

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

Issue 780133002: Add optimization for CHROMIUM_subscribe_uniform extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: piman@ review Created 6 years 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.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 7bf61344c8fb2029e179fd21b2a92e5a9219f7c6..b3e2fac0a6eedbbaa75ba8363adc874371dcb555 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -29,6 +29,7 @@
#include "gpu/command_buffer/service/image_factory.h"
#include "gpu/command_buffer/service/mailbox_manager_impl.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
+#include "gpu/command_buffer/service/valuebuffer_manager.h"
#include "ipc/ipc_channel.h"
#include "ipc/message_filter.h"
#include "ui/gl/gl_context.h"
@@ -425,10 +426,14 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages);
+
+ subscription_ref_set_ = new gpu::gles2::SubscriptionRefSet();
+ subscription_ref_set_->AddObserver(this);
}
GpuChannel::~GpuChannel() {
STLDeleteElements(&deferred_messages_);
+ subscription_ref_set_->RemoveObserver(this);
if (preempting_flag_.get())
preempting_flag_->Reset();
}
@@ -512,6 +517,16 @@ bool GpuChannel::Send(IPC::Message* message) {
return channel_->Send(message);
}
+void GpuChannel::OnAddSubscription(unsigned int target) {
+ gpu_channel_manager()->Send(
+ new GpuHostMsg_AddSubscription(client_id_, target));
+}
+
+void GpuChannel::OnRemoveSubscription(unsigned int target) {
+ gpu_channel_manager()->Send(
+ new GpuHostMsg_RemoveSubscription(client_id_, target));
+}
+
void GpuChannel::RequeueMessage() {
DCHECK(currently_processing_message_);
deferred_messages_.push_front(
@@ -581,6 +596,7 @@ CreateCommandBufferResult GpuChannel::CreateViewCommandBuffer(
share_group,
window,
mailbox_manager_.get(),
+ subscription_ref_set_.get(),
pending_valuebuffer_state_.get(),
gfx::Size(),
disallowed_features_,
@@ -740,6 +756,7 @@ void GpuChannel::OnCreateOffscreenCommandBuffer(
share_group,
gfx::GLSurfaceHandle(),
mailbox_manager_.get(),
+ subscription_ref_set_.get(),
pending_valuebuffer_state_.get(),
size,
disallowed_features_,

Powered by Google App Engine
This is Rietveld 408576698