Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Starred by 2 users
Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 563816



Sign in to add a comment
OffscreenCanvas.commit() doe not handle multiple HTML canvases properly
Project Member Reported by xlai@chromium.org, Nov 2 2016 Back to list
The current mechanism cannot support the attached use case when there
are more than 1 html canvases and more than 1 offscreenCanvases, each 
doing their own painting and commit() independently.

The root cause might be the fact that HTMLCanvasElement is sharing
the same OffscreenCanvasSurface interface without proper handling of
multiple instances.

 
Comment 1 by xlai@chromium.org, Nov 2 2016
Blocking: 563816
Comment 2 by xlai@chromium.org, Nov 2 2016
Summary: OffscreenCanvas.commit() doe not handle multiple HTML canvases properly (was: OffscreenCanvas.commit() cannot handle multiple HTML canvases)
Labels: -Pri-1 Pri-2
The refactor which will handle the resize problem should solve this problem at the same time.
Comment 4 by xlai@chromium.org, Nov 7 2016
Status: Started
Yup, CL (https://codereview.chromium.org/2479563005/) is out waiting for review.
I'm not really understanding what an OffscreenCanvasSurface is and what an OffscreenCompositorFrameSink is. Could you please explain the roles of the two classes in your view?
Comment 6 by xlai@chromium.org, Nov 14 2016
Perhaps this diagram explains better: 
https://www.lucidchart.com/documents/view/ee79924f-2d46-46ee-8da7-9ecd220eb6b1

OffscreenCanvasSurface is a service to connect to the HTMLCanvasElement on the
main
thread when it is about to create a SurfaceLayer (that requires a SurfaceId in
hand,
however, in the future when SurfaceId can be created on renderer), the
GetSurfaceId
IPC may no longer be needed. But even at that time, OffscreenCanvasSurface still

has its function to connect renderer/main thread to browser/UI thread. I have
plans
in OffscreenCanvas resizing to make it a two-way communication.

OffscreenCanvasCompositorFrameSink is a service to connect to the
OffscreenCanvas on 
the worker thread.
Project Member Comment 7 by bugdroid1@chromium.org, Nov 17 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/92e403ca88572c004290ab15450ce3f6b030cbbd

commit 92e403ca88572c004290ab15450ce3f6b030cbbd
Author: xlai <xlai@chromium.org>
Date: Thu Nov 17 19:25:05 2016

Create manager to track OffscreenCanvasSurfaceImpl instances

OffscreenCanvasSurfaceManager is a singleton in browser UI thread to keep track
of OffscreenCanvasSurfaceImpl instances (which connects to renderer/main thread).
Each instance corresponds to one single pair of html canvas
and its transferred OffscreenCanvas in renderer process and is therefore
identified by a unique FrameSinkId.

The manager is lazily created. It is useful in two cases:
(1) managing the situation of multiple html canvases that have transferred
to offscreen.
(2) allowing the OffscreenCanvasCompositorFrameSink instance (which connects to
 OffscreenCanvas on renderer/worker) to connect to its counterpart
OffscreenCanvasSurfaceImpl; this is to facilitate OffscreenCanvas resizing workflow
 implementation in next CLs.

BUG= 661605 , 662498 

Review-Url: https://codereview.chromium.org/2479563005
Cr-Commit-Position: refs/heads/master@{#432930}

[modify] https://crrev.com/92e403ca88572c004290ab15450ce3f6b030cbbd/content/browser/BUILD.gn
[modify] https://crrev.com/92e403ca88572c004290ab15450ce3f6b030cbbd/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
[modify] https://crrev.com/92e403ca88572c004290ab15450ce3f6b030cbbd/content/browser/renderer_host/offscreen_canvas_surface_impl.h
[add] https://crrev.com/92e403ca88572c004290ab15450ce3f6b030cbbd/content/browser/renderer_host/offscreen_canvas_surface_manager.cc
[add] https://crrev.com/92e403ca88572c004290ab15450ce3f6b030cbbd/content/browser/renderer_host/offscreen_canvas_surface_manager.h
[add] https://crrev.com/92e403ca88572c004290ab15450ce3f6b030cbbd/content/browser/renderer_host/offscreen_canvas_surface_manager_unittest.cc
[modify] https://crrev.com/92e403ca88572c004290ab15450ce3f6b030cbbd/content/test/BUILD.gn

Comment 8 by xlai@chromium.org, Dec 19 2016
Status: Fixed
Sign in to add a comment