| Index: gpu/ipc/service/stream_texture_android.cc
|
| diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
|
| index 684099330ff20a4f94782496c0d9adccec0fc3dc..f893a7dc54af18c010bfe8c5feb651ee97009457 100644
|
| --- a/gpu/ipc/service/stream_texture_android.cc
|
| +++ b/gpu/ipc/service/stream_texture_android.cc
|
| @@ -12,6 +12,7 @@
|
| #include "gpu/command_buffer/service/context_state.h"
|
| #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
|
| #include "gpu/command_buffer/service/texture_manager.h"
|
| +#include "gpu/ipc/common/android/surface_texture_manager.h"
|
| #include "gpu/ipc/common/android/surface_texture_peer.h"
|
| #include "gpu/ipc/common/gpu_messages.h"
|
| #include "gpu/ipc/service/gpu_channel.h"
|
| @@ -74,6 +75,7 @@ StreamTexture::StreamTexture(GpuCommandBufferStub* owner_stub,
|
| program_(0),
|
| vertex_buffer_(0),
|
| u_xform_location_(-1),
|
| + registered_surface_texture_id(0),
|
| weak_factory_(this) {
|
| owner_stub->AddDestructionObserver(this);
|
| memset(current_matrix_, 0, sizeof(current_matrix_));
|
| @@ -87,6 +89,11 @@ StreamTexture::~StreamTexture() {
|
| owner_stub_->RemoveDestructionObserver(this);
|
| owner_stub_->channel()->RemoveRoute(route_id_);
|
| }
|
| +
|
| + if (registered_surface_texture_id) {
|
| + SurfaceTextureManager::GetInstance()->UnregisterBrowserSurfaceTexture(
|
| + registered_surface_texture_id);
|
| + }
|
| }
|
|
|
| // gpu::gles2::GLStreamTextureMatrix implementation
|
| @@ -225,6 +232,8 @@ bool StreamTexture::OnMessageReceived(const IPC::Message& message) {
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(StreamTexture, message)
|
| IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_StartListening, OnStartListening)
|
| + IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_RegisterStreamTexture,
|
| + OnRegisterStreamTexture)
|
| IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_EstablishPeer, OnEstablishPeer)
|
| IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_SetSize, OnSetSize)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| @@ -249,6 +258,17 @@ void StreamTexture::OnEstablishPeer(int32_t primary_id, int32_t secondary_id) {
|
| process, surface_texture_, primary_id, secondary_id);
|
| }
|
|
|
| +void StreamTexture::OnRegisterStreamTexture(int32_t surface_texture_id) {
|
| + if (!owner_stub_)
|
| + return;
|
| +
|
| + DCHECK(!registered_surface_texture_id);
|
| + registered_surface_texture_id = surface_texture_id;
|
| +
|
| + SurfaceTextureManager::GetInstance()->RegisterBrowserSurfaceTexture(
|
| + surface_texture_id, surface_texture_.get());
|
| +}
|
| +
|
| bool StreamTexture::BindTexImage(unsigned target) {
|
| NOTREACHED();
|
| return false;
|
|
|