Commit 228446ba authored by Kai Ninomiya's avatar Kai Ninomiya Committed by Commit Bot

Use unverified sync tokens in PaintCanvasVideoRenderer

PaintCanvasVideoRenderer::CopyVideoFrameTexturesToGLTexture
unnecessarily used verified sync tokens to pass textures between
Skia's context and WebGL's context. Verification isn't needed
because these two clients are being used synchronously from the
same process and thread.

Changing these sync tokens to be unverified gives us a nice
speedup - on a simple mp4-to-WebGL case on Linux, the texImage2D
blocking time drops from ~1.25 ms to ~0.70ms (~80% speedup).

Bug: 871417
Change-Id: I38c246fdb49588eccc87211fa06a2abf00e55c5c
Reviewed-on: https://chromium-review.googlesource.com/1164163Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584840}
parent 18d49544
...@@ -916,7 +916,8 @@ bool PaintCanvasVideoRenderer::CopyVideoFrameTexturesToGLTexture( ...@@ -916,7 +916,8 @@ bool PaintCanvasVideoRenderer::CopyVideoFrameTexturesToGLTexture(
// Wait for mailbox creation on canvas context before consuming it and // Wait for mailbox creation on canvas context before consuming it and
// copying from it on the consumer context. // copying from it on the consumer context.
canvas_gl->GenSyncTokenCHROMIUM(mailbox_holder.sync_token.GetData()); canvas_gl->GenUnverifiedSyncTokenCHROMIUM(
mailbox_holder.sync_token.GetData());
destination_gl->WaitSyncTokenCHROMIUM( destination_gl->WaitSyncTokenCHROMIUM(
mailbox_holder.sync_token.GetConstData()); mailbox_holder.sync_token.GetConstData());
...@@ -933,7 +934,7 @@ bool PaintCanvasVideoRenderer::CopyVideoFrameTexturesToGLTexture( ...@@ -933,7 +934,7 @@ bool PaintCanvasVideoRenderer::CopyVideoFrameTexturesToGLTexture(
// Wait for destination context to consume mailbox before deleting it in // Wait for destination context to consume mailbox before deleting it in
// canvas context. // canvas context.
gpu::SyncToken dest_sync_token; gpu::SyncToken dest_sync_token;
destination_gl->GenSyncTokenCHROMIUM(dest_sync_token.GetData()); destination_gl->GenUnverifiedSyncTokenCHROMIUM(dest_sync_token.GetData());
canvas_gl->WaitSyncTokenCHROMIUM(dest_sync_token.GetConstData()); canvas_gl->WaitSyncTokenCHROMIUM(dest_sync_token.GetConstData());
SyncTokenClientImpl client(canvas_gl); SyncTokenClientImpl client(canvas_gl);
......
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