Chromium Code Reviews| Index: content/common/gpu/client/gpu_channel_host.cc |
| diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc |
| index 237a1d31f10bef6786926618715d536cdcf73b9f..287f70249ad48e9e13c03373be0a8d16283aba59 100644 |
| --- a/content/common/gpu/client/gpu_channel_host.cc |
| +++ b/content/common/gpu/client/gpu_channel_host.cc |
| @@ -61,7 +61,8 @@ GpuChannelHost::GpuChannelHost( |
| gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) |
| : factory_(factory), |
| gpu_info_(gpu_info), |
| - gpu_memory_buffer_manager_(gpu_memory_buffer_manager) { |
| + gpu_memory_buffer_manager_(gpu_memory_buffer_manager), |
| + command_buffer_routing_id_(0) { |
| next_transfer_buffer_id_.GetNext(); |
| next_image_id_.GetNext(); |
| next_route_id_.GetNext(); |
| @@ -235,6 +236,7 @@ CommandBufferProxyImpl* GpuChannelHost::CreateOffscreenCommandBuffer( |
| CommandBufferProxyImpl* command_buffer = |
| new CommandBufferProxyImpl(this, route_id); |
| AddRoute(route_id, command_buffer->AsWeakPtr()); |
| + command_buffer_routing_id_ = route_id; |
|
piman
2015/06/30 23:04:20
NAK. A channel has multiple command buffers, and t
sivag
2015/07/16 14:24:58
Done.
|
| AutoLock lock(context_lock_); |
| proxies_[route_id] = command_buffer; |
| @@ -291,6 +293,7 @@ void GpuChannelHost::DestroyCommandBuffer( |
| AutoLock lock(context_lock_); |
| proxies_.erase(route_id); |
| + command_buffer_routing_id_ = 0; |
| if (flush_info_.flush_pending && flush_info_.route_id == route_id) |
| flush_info_.flush_pending = false; |
| @@ -396,6 +399,18 @@ GpuChannelHost::~GpuChannelHost() { |
| #endif |
| } |
| +unsigned GpuChannelHost::CreateStreamTexture(int32 image_id) { |
| + DCHECK(command_buffer_routing_id_); |
| + int32 stream_id = GenerateRouteID(); |
| + bool succeeded = factory_->CreateStreamTexture( |
| + image_id, command_buffer_routing_id_, stream_id); |
| + if (!succeeded) { |
| + DLOG(ERROR) << "GpuCommandBufferMsg_CreateStreamTexture returned failure"; |
| + return 0; |
| + } |
| + return stream_id; |
| +} |
| + |
| GpuChannelHost::MessageFilter::MessageFilter() |
| : lost_(false) { |
| } |