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

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

Issue 1414793018: Revert of Converted video frame and image callbacks to use new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/gl_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b8785bc64a6fe12bee74f6c88a3e595c0b9084bc..c3c841924355e6beb7f1f3e4685d20e688248ff0 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -400,7 +400,7 @@
int32_t CommandBufferProxyImpl::CreateImage(ClientBuffer buffer,
size_t width,
size_t height,
- unsigned internal_format) {
+ unsigned internalformat) {
CheckLock();
if (last_state_.error != gpu::error::kNoError)
return -1;
@@ -416,47 +416,29 @@
// 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_token = false;
+ bool requires_sync_point = false;
gfx::GpuMemoryBufferHandle handle =
channel_->ShareGpuMemoryBufferToGpuProcess(gpu_memory_buffer->GetHandle(),
- &requires_sync_token);
-
- uint64_t image_fence_sync = 0;
- if (requires_sync_token) {
- image_fence_sync = GenerateFenceSyncRelease();
-
- // Make sure fence syncs were flushed before CreateImage() was called.
- DCHECK_LE(image_fence_sync - 1, flushed_fence_sync_release_);
- }
+ &requires_sync_point);
DCHECK(gpu::ImageFactory::IsGpuMemoryBufferFormatSupported(
gpu_memory_buffer->GetFormat(), capabilities_));
DCHECK(gpu::ImageFactory::IsImageSizeValidForGpuMemoryBufferFormat(
gfx::Size(width, height), gpu_memory_buffer->GetFormat()));
DCHECK(gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat(
- internal_format, gpu_memory_buffer->GetFormat()));
-
- GpuCommandBufferMsg_CreateImage_Params params;
- params.id = new_id;
- params.gpu_memory_buffer = handle;
- params.size = gfx::Size(width, height);
- params.format = gpu_memory_buffer->GetFormat();
- params.internal_format = internal_format;
- params.image_release_count = image_fence_sync;
-
- if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_, params)))
+ internalformat, gpu_memory_buffer->GetFormat()));
+ if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_,
+ new_id,
+ handle,
+ gfx::Size(width, height),
+ gpu_memory_buffer->GetFormat(),
+ internalformat))) {
return -1;
-
- if (image_fence_sync) {
- gpu::SyncToken sync_token(GetNamespaceID(), GetCommandBufferID(),
- image_fence_sync);
-
- // Force a synchronous IPC to validate sync token.
- channel_->ValidateFlushIDReachedServer(stream_id_, true);
- sync_token.SetVerifyFlush();
-
- gpu_memory_buffer_manager->SetDestructionSyncToken(gpu_memory_buffer,
- sync_token);
+ }
+
+ if (requires_sync_point) {
+ gpu_memory_buffer_manager->SetDestructionSyncPoint(gpu_memory_buffer,
+ InsertSyncPoint());
}
return new_id;
@@ -473,18 +455,18 @@
int32_t CommandBufferProxyImpl::CreateGpuMemoryBufferImage(
size_t width,
size_t height,
- unsigned internal_format,
+ unsigned internalformat,
unsigned usage) {
CheckLock();
scoped_ptr<gfx::GpuMemoryBuffer> buffer(
channel_->gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer(
gfx::Size(width, height),
- gpu::ImageFactory::DefaultBufferFormatForImageFormat(internal_format),
+ gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat),
gfx::BufferUsage::SCANOUT));
if (!buffer)
return -1;
- return CreateImage(buffer->AsClientBuffer(), width, height, internal_format);
+ return CreateImage(buffer->AsClientBuffer(), width, height, internalformat);
}
uint32 CommandBufferProxyImpl::CreateStreamTexture(uint32 texture_id) {
@@ -548,8 +530,7 @@
return true;
// Has not been validated, validate it now.
- UpdateVerifiedReleases(
- channel_->ValidateFlushIDReachedServer(stream_id_, false));
+ UpdateVerifiedReleases(channel_->ValidateFlushIDReachedServer(stream_id_));
return release <= verified_fence_sync_release_;
}
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/gl_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698