Commit 2dc7fd65 authored by Khushal Sagar's avatar Khushal Sagar Committed by Commit Bot

media: Ensure sync token synchronization for VideoFrame images.

Instead of relying on the sync token returned by
AcceleratedStaticBitmapImage to ensure synchronization with the raster
stream used by skia, perform this when the mailbox is returned. This is
temporary to allow merging a safer change to 86 release branch.

R=dalecurtis@chromium.org

Bug: 1131123
Change-Id: I639a0d864fae29ddb32182aeda5ba2e854b1f5ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2433049
Commit-Queue: Khushal <khushalsagar@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810936}
parent 8bc42a8c
...@@ -401,10 +401,16 @@ ScriptPromise VideoFrame::CreateImageBitmap(ScriptState* script_state, ...@@ -401,10 +401,16 @@ ScriptPromise VideoFrame::CreateImageBitmap(ScriptState* script_state,
->GenUnverifiedSyncTokenCHROMIUM(sync_token.GetData()); ->GenUnverifiedSyncTokenCHROMIUM(sync_token.GetData());
auto release_callback = viz::SingleReleaseCallback::Create(base::BindOnce( auto release_callback = viz::SingleReleaseCallback::Create(base::BindOnce(
[](gpu::SharedImageInterface* sii, gpu::Mailbox mailbox, [](viz::RasterContextProvider* context, gpu::Mailbox mailbox,
const gpu::SyncToken& sync_token, const gpu::SyncToken& sync_token, bool is_lost) {
bool is_lost) { sii->DestroySharedImage(sync_token, mailbox); }, auto* ri = context->RasterInterface();
base::Unretained(shared_image_interface), dest_holder.mailbox)); auto* sii = context->SharedImageInterface();
ri->WaitSyncTokenCHROMIUM(sync_token.GetConstData());
gpu::SyncToken ri_sync_token;
ri->GenUnverifiedSyncTokenCHROMIUM(ri_sync_token.GetData());
sii->DestroySharedImage(ri_sync_token, mailbox);
},
base::Unretained(raster_context_provider), dest_holder.mailbox));
const SkImageInfo sk_image_info = const SkImageInfo sk_image_info =
SkImageInfo::Make(codedWidth(), codedHeight(), kN32_SkColorType, SkImageInfo::Make(codedWidth(), codedHeight(), kN32_SkColorType,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment