New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 883927 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Use Surface Synchronization for Offscreen canvas/video surfaces

Project Member Reported by fsam...@chromium.org, Sep 13

Issue description

Currently, on resize, offscreen canvas and video surfaces (SurfaceLayerBridge) embed a new SurfaceId in OnFirstSurfaceActivation. This means that the new size is always presented at least one frame behind. SurfaceLayerBridge should just use surface sync and should be the one to allocate the LocalSurfaceId before passing it off to the worker thread or media thread.
 
Similarly:
  CanvasResourceDispatcher::PrepareFrame is generating new ids in response to resize at frame submission time.
  VideoFrameSubmitter::SubmitFrame is generating new ids in response to resize at frame submittion time.
Cc: fsam...@chromium.org
Status: Available (was: Untriaged)
I noticed that requests to change offscreen canvas's size come from javascript. It's not possible to pass a LocalSurfaceId alongside the size, so it has to be the child that allocates the id. It's still possible to get rid of OnFirstSurfaceActivation. I'm going to establish a mojo connection between the submitter and SurfaceLayerBridge mediated by the browser, so that every time a new id is allocated we can notify SurfaceLayerBridge without necessarily waiting for activation.

Why is it not possible to pass a LocalSurfaceId alongside the size?
Because I don't know how to do that over javascript.
Cc: jbroman@chromium.org
Perhaps jbroman@ can help here provide some guidance? Jeremy?
If we align the allocation with size change (as opposed to BeginFrame) we won't have to worry about one frame latency and I don't think it would be a big deal if the child does the allocation.
I don't really understand surfaces well enough to have an informed opinion here. Author script presumably has no idea what a "local surface ID" is as that's a Chromium implementation detail, but I don't know how that relates to surface allocation.
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d2f538cffc7ef006234a6beae7e2411ca49d4c30

commit d2f538cffc7ef006234a6beae7e2411ca49d4c30
Author: Saman Sami <samans@chromium.org>
Date: Mon Nov 19 22:24:59 2018

Stop sending OnFirstSurfaceActivation to SurfaceLayerBridge

Establish a direct connection from the child (CanvasResourceDispatcher/
VideoFrameSubmitter) to the embedder (SuraceLayerBridge) so the child
can notify the embedder of its allocated SurfaceIds directly instead of
three process hops (renderer->viz->browser->renderer), hence reducing
latency and eliminating any IPC messages involved in this process.

Bug: 893850,883927
Change-Id: Ide595e3c6aa995c77678d6413d5ad6421e2d35e5
Reviewed-on: https://chromium-review.googlesource.com/c/1338411
Commit-Queue: Saman Sami <samans@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609469}
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/content/browser/renderer_host/embedded_frame_sink_impl.cc
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/content/browser/renderer_host/embedded_frame_sink_impl.h
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/content/browser/renderer_host/embedded_frame_sink_provider_impl.cc
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/content/browser/renderer_host/embedded_frame_sink_provider_impl.h
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/content/browser/renderer_host/embedded_frame_sink_provider_impl_unittest.cc
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/public/platform/modules/frame_sinks/embedded_frame_sink.mojom
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/begin_frame_provider.h
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.cc
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/canvas_resource_dispatcher.h
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/surface_layer_bridge.cc
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/surface_layer_bridge.h
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/test/mock_embedded_frame_sink_provider.h
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/video_frame_submitter.cc
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/video_frame_submitter.h
[modify] https://crrev.com/d2f538cffc7ef006234a6beae7e2411ca49d4c30/third_party/blink/renderer/platform/graphics/video_frame_submitter_test.cc

Sign in to add a comment