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

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: Created 4 years, 6 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 8d608bd6d6122961e09862fc9663d2962a2dd5e4..5a537bb3ca0b06d66f67da7d2e064e682b92be62 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -191,7 +191,8 @@ 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(),
resource_provider_->GetResourceTextureTarget(resource_id),
@@ -584,9 +585,7 @@ void VideoResourceUpdater::CopyPlaneTexture(
resource->add_ref();
ResourceProvider::ScopedWriteLockGL lock(resource_provider_,
- resource->resource_id());
- uint32_t texture_id = lock.texture_id();
-
+ resource->resource_id(), false);
DCHECK_EQ(
resource_provider_->GetResourceTextureTarget(resource->resource_id()),
(GLenum)GL_TEXTURE_2D);
@@ -594,7 +593,7 @@ void VideoResourceUpdater::CopyPlaneTexture(
gl->WaitSyncTokenCHROMIUM(mailbox_holder.sync_token.GetConstData());
uint32_t src_texture_id = gl->CreateAndConsumeTextureCHROMIUM(
mailbox_holder.texture_target, mailbox_holder.mailbox.name);
- gl->CopySubTextureCHROMIUM(src_texture_id, texture_id, 0, 0, 0, 0,
+ gl->CopySubTextureCHROMIUM(src_texture_id, lock.texture_id(), 0, 0, 0, 0,
output_plane_resource_size.width(),
output_plane_resource_size.height(), false, false,
false);

Powered by Google App Engine
This is Rietveld 408576698