Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1040)

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 654223006: Cleanup GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698