| Index: gpu/ipc/client/command_buffer_proxy_impl.cc
|
| diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc
|
| index 07c31ff9a951eb93f66c7133586559ffc5fe65a4..88be6e52458adb8f87cf0ca8971ba9d263ec170e 100644
|
| --- a/gpu/ipc/client/command_buffer_proxy_impl.cc
|
| +++ b/gpu/ipc/client/command_buffer_proxy_impl.cc
|
| @@ -664,6 +664,42 @@ void CommandBufferProxyImpl::SignalQuery(uint32_t query,
|
| signal_tasks_.insert(std::make_pair(signal_id, callback));
|
| }
|
|
|
| +int32_t CommandBufferProxyImpl::CreateFence(ClientFence fence) {
|
| + CheckLock();
|
| + if (last_state_.error != gpu::error::kNoError)
|
| + return -1;
|
| +
|
| + int32_t new_id = channel_->ReserveFenceId();
|
| +
|
| + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager =
|
| + channel_->gpu_memory_buffer_manager();
|
| + gfx::GpuFence* gpu_fence =
|
| + gpu_memory_buffer_manager->GpuFenceFromClientFence(fence);
|
| + DCHECK(gpu_fence);
|
| +
|
| + // This handle is owned by the GPU process and must be passed to it or it
|
| + // will leak. In otherwords, do not early out on error between here and the
|
| + // sending of the CreateFence IPC below.
|
| + gfx::GpuFenceHandle handle =
|
| + channel_->ShareGpuFenceToGpuProcess(gpu_fence->GetHandle());
|
| +
|
| + GpuCommandBufferMsg_CreateFence_Params params;
|
| + params.id = new_id;
|
| + params.gpu_fence = handle;
|
| +
|
| + Send(new GpuCommandBufferMsg_CreateFence(route_id_, params));
|
| +
|
| + return new_id;
|
| +}
|
| +
|
| +void CommandBufferProxyImpl::DestroyFence(int32_t id) {
|
| + CheckLock();
|
| + if (last_state_.error != gpu::error::kNoError)
|
| + return;
|
| +
|
| + Send(new GpuCommandBufferMsg_DestroyFence(route_id_, id));
|
| +}
|
| +
|
| void CommandBufferProxyImpl::TakeFrontBuffer(const gpu::Mailbox& mailbox) {
|
| CheckLock();
|
| if (last_state_.error != gpu::error::kNoError)
|
|
|