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

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

Issue 10695181: [Android] Upstream all the IPC communications/handlings for stream texture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove #pragma once 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
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index eeefa4cec71aa1bd3b349654f185590c090dff54..586d2495b1ba8bc1c3e50e3650cfa540411eeaca 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -31,6 +31,10 @@
#include "ipc/ipc_channel_posix.h"
#endif
+#if defined(OS_ANDROID)
+#include "content/common/gpu/stream_texture_manager_android.h"
+#endif
+
namespace {
// This filter does two things:
// - it counts the number of messages coming in on the channel
@@ -163,6 +167,9 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages);
disallowed_features_.multisampling =
command_line->HasSwitch(switches::kDisableGLMultisampling);
+#if defined(OS_ANDROID)
+ stream_texture_manager_.reset(new content::StreamTextureManagerAndroid(this));
+#endif
}
@@ -388,6 +395,12 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
OnCreateOffscreenCommandBuffer)
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_DestroyCommandBuffer,
OnDestroyCommandBuffer)
+#if defined(OS_ANDROID)
+ IPC_MESSAGE_HANDLER(GpuChannelMsg_RegisterStreamTextureProxy,
+ OnRegisterStreamTextureProxy)
+ IPC_MESSAGE_HANDLER(GpuChannelMsg_EstablishStreamTexture,
+ OnEstablishStreamTexture)
+#endif
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
DCHECK(handled) << msg.type();
@@ -506,3 +519,22 @@ void GpuChannel::OnDestroyCommandBuffer(int32 route_id,
Send(reply_message);
}
+#if defined(OS_ANDROID)
+void GpuChannel::OnRegisterStreamTextureProxy(
+ int32 stream_id, const gfx::Size& initial_size, int32* route_id) {
+ // Note that route_id is only used for notifications sent out from here.
+ // StreamTextureManager owns all texture objects and for incoming messages
+ // it finds the correct object based on stream_id.
+ *route_id = GenerateRouteID();
+ stream_texture_manager_->RegisterStreamTextureProxy(
+ stream_id, initial_size, *route_id);
+}
+
+void GpuChannel::OnEstablishStreamTexture(
+ int32 stream_id, content::SurfaceTexturePeer::SurfaceTextureTarget type,
+ int32 primary_id, int32 secondary_id) {
+ stream_texture_manager_->EstablishStreamTexture(
+ stream_id, type, primary_id, secondary_id);
+}
+#endif
+
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698