Use Surface Synchronization for Offscreen canvas/video surfaces |
|||
Issue descriptionCurrently, 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.
,
Oct 10
,
Nov 15
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.
,
Nov 15
Why is it not possible to pass a LocalSurfaceId alongside the size?
,
Nov 15
Because I don't know how to do that over javascript.
,
Nov 15
Perhaps jbroman@ can help here provide some guidance? Jeremy?
,
Nov 15
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.
,
Nov 16
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.
,
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 |
|||
Comment 1 by jonr...@chromium.org
, Sep 13