New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Fixed
Closed: Dec 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

issue 563816

Sign in to add a comment

OffscreenCanvas.commit() doe not handle multiple HTML canvases properly

Project Member Reported by, Nov 2 2016 Back to list

Issue description

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, Nov 2 2016

Blocking: 563816

Comment 2 by, 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, Nov 7 2016

Status: Started (was: Assigned)
Yup, CL ( 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, Nov 14 2016

Perhaps this diagram explains better:

OffscreenCanvasSurface is a service to connect to the HTMLCanvasElement on the
thread when it is about to create a SurfaceLayer (that requires a SurfaceId in
however, in the future when SurfaceId can be created on renderer), the
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
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, Nov 17 2016

The following revision refers to this bug:

commit 92e403ca88572c004290ab15450ce3f6b030cbbd
Author: xlai <>
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 

Cr-Commit-Position: refs/heads/master@{#432930}


Comment 8 by, Dec 19 2016

Status: Fixed (was: Started)

Sign in to add a comment