| 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
|
| +
|
|
|