Chromium Code Reviews| Index: content/common/gpu/client/command_buffer_proxy_impl.cc |
| diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc |
| index 9acf05a9b314b1c6b4362152804814b1d8354d4e..d8ee5615eafee080708b02cc1f266bafde4cac77 100644 |
| --- a/content/common/gpu/client/command_buffer_proxy_impl.cc |
| +++ b/content/common/gpu/client/command_buffer_proxy_impl.cc |
| @@ -308,17 +308,19 @@ int32_t CommandBufferProxyImpl::CreateImage(ClientBuffer buffer, |
| int32 new_id = channel_->ReserveImageId(); |
| + gpu::GpuMemoryBufferManager* memory_buffer_manager = |
|
reveman
2014/11/03 22:26:12
nit: do you need this temporary variable? if you d
|
| + channel_->gpu_memory_buffer_manager(); |
| gfx::GpuMemoryBuffer* gpu_memory_buffer = |
| - channel_->gpu_memory_buffer_manager()->GpuMemoryBufferFromClientBuffer( |
| - buffer); |
| + memory_buffer_manager->GpuMemoryBufferFromClientBuffer(buffer); |
| DCHECK(gpu_memory_buffer); |
| // 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 CreateImage IPC below. |
| + bool requires_sync_point = false; |
| gfx::GpuMemoryBufferHandle handle = |
| - channel_->ShareGpuMemoryBufferToGpuProcess( |
| - gpu_memory_buffer->GetHandle()); |
| + channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(), |
| + &requires_sync_point); |
| DCHECK(gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat( |
| internalformat, gpu_memory_buffer->GetFormat())); |
| @@ -331,6 +333,11 @@ int32_t CommandBufferProxyImpl::CreateImage(ClientBuffer buffer, |
| return -1; |
| } |
| + if (requires_sync_point) { |
| + memory_buffer_manager->RecordDestructionSyncPoint(buffer, |
| + InsertSyncPoint()); |
| + } |
| + |
| return new_id; |
| } |