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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 1951193002: cc: Add mailbox support to ResourceProvider write locks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@worker_context_stream
Patch Set: fix gpu Created 4 years, 7 months 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: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index e77cd7505af1c58cecfbfe1f07bb0d32f9641a01..704d6701cc5061a1a8f5126adf0dbb31cd6944e6 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -219,11 +219,13 @@ VideoResourceUpdater::AllocateResource(const gfx::Size& plane_size,
gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL();
gl->GenMailboxCHROMIUM(mailbox.name);
- ResourceProvider::ScopedWriteLockGL lock(resource_provider_, resource_id);
+ ResourceProvider::ScopedWriteLockGL lock(resource_provider_, resource_id,
+ false);
gl->ProduceTextureDirectCHROMIUM(
- lock.texture_id(),
+ lock.ProduceTextureId(),
resource_provider_->GetResourceTextureTarget(resource_id),
mailbox.name);
+ lock.ReleaseTextureId();
}
all_resources_.push_front(
PlaneResource(resource_id, plane_size, format, mailbox));
@@ -629,8 +631,8 @@ void VideoResourceUpdater::CopyPlaneTexture(
++resource->ref_count;
ResourceProvider::ScopedWriteLockGL lock(resource_provider_,
- resource->resource_id);
- uint32_t texture_id = lock.texture_id();
+ resource->resource_id, false);
+ uint32_t texture_id = lock.ProduceTextureId();
DCHECK_EQ(resource_provider_->GetResourceTextureTarget(resource->resource_id),
(GLenum)GL_TEXTURE_2D);
@@ -650,6 +652,8 @@ void VideoResourceUpdater::CopyPlaneTexture(
gl->ShallowFlushCHROMIUM();
gl->GenSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
+ lock.ReleaseTextureId();
+
// Done with the source video frame texture at this point.
video_frame->UpdateReleaseSyncToken(&client);

Powered by Google App Engine
This is Rietveld 408576698