Skip to content

Commit 3c8a7d5

Browse files
ccameron-chromiumChromium LUCI CQ
authored andcommitted
WebMediaPlayerMSCompositor: Fix excessive canvas cache reset
PaintCanvasVideoRenderer, for complicated reasons, maintains a cached texture resulting from an YUV to RGB conversion. The goal of the cache is not to avoid repeated YUV to RGB conversions, but to avoid repeated allocation and freeing of the RGB texture every frame. WebMediaPlayerMSCompositor::CheckForFrameChanges resets this cache every time it gets a new frame, which makes the cache in PaintCanvasVideoRenderer useless. Change WebMediaPlayerMSCompositor::CheckForFrameChanges to only reset the cache when the frame size changes. Bug: 1235686 Change-Id: If8a6746fdc6828b9852653631d0de72777877b9c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3089355 Reviewed-by: Guido Urdaneta <[email protected]> Reviewed-by: Dale Curtis <[email protected]> Commit-Queue: ccameron <[email protected]> Cr-Commit-Position: refs/heads/master@{#911727}
1 parent d8c1426 commit 3c8a7d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,10 @@ void WebMediaPlayerMSCompositor::CheckForFrameChanges(
708708
PostCrossThreadTask(
709709
*main_task_runner_, FROM_HERE,
710710
CrossThreadBindOnce(&WebMediaPlayerMS::TriggerResize, player_));
711+
PostCrossThreadTask(
712+
*main_task_runner_, FROM_HERE,
713+
CrossThreadBindOnce(&WebMediaPlayerMS::ResetCanvasCache, player_));
711714
}
712-
PostCrossThreadTask(
713-
*main_task_runner_, FROM_HERE,
714-
CrossThreadBindOnce(&WebMediaPlayerMS::ResetCanvasCache, player_));
715715
}
716716

717717
void WebMediaPlayerMSCompositor::StartRenderingInternal() {

0 commit comments

Comments
 (0)