New issue
Advanced search Search tips
Starred by 94 users
Status: Assigned
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Sign in to add a comment
Implement and ship the OffscreenCanvas feature
Project Member Reported by, Dec 1 2015 Back to list
Spec is a work in progress at this time.
Feature proposal:
Mozilla's implementation, for reference/compat:
Comment 1 by, Dec 1 2015
Blockedon: chromium:249384
Comment 2 by, Dec 1 2015
Blockedon: chromium:563819
Comment 3 by, Dec 1 2015
Blockedon: chromium:563826
Comment 4 by, Dec 1 2015
Blockedon: chromium:563827
Comment 5 by, Dec 1 2015
Blockedon: chromium:563830
Comment 6 by, Dec 1 2015
Blockedon: chromium:563832
Comment 7 by, Dec 1 2015
Blockedon: chromium:563845
Comment 8 by, Dec 1 2015
Blockedon: chromium:563852
Comment 9 by, Dec 1 2015
Blockedon: chromium:563856
Blockedon: chromium:563858
Blockedon: chromium:563861
Blockedon: chromium:563863
Blockedon: chromium:563868
Blockedon: chromium:563870
Blockedon: chromium:565077
Status: Assigned
Blockedon: chromium:585607
I don't know if if this is a separate issue or just because it's not implemented yet; OffscreenCanvasRenderingContext2D.drawImage won't accept another OffscreenCanvas as an input.
Gives error "The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)"
Comment 20 by, Jul 27 2016
#18: Right. We haven't have a stable spec for OffscreenCanvasRenderingContext2D yet; so right now we implement most of its functions by following existing spec of HTML canvas 2d ( which states the image source can be only one of the four types mentioned above.

junov@: How do you think about having OffscreenCanvas as one of the CanvasImageSource for OffscreenCanvasRenderingContext2d in the spec?

Comment 21 by, Jul 27 2016
Blockedon: 632015
Comment 22 by, Jul 27 2016
Blockedon: 632016
Comment 23 by, Jul 27 2016
Good point, I just attached two child bugs to add OffscreenCanvas to the CanvasImageSource and ImageBitmapSource IDL union types respectively.  This will allow OffscreenCanvases to be used with drawImage, createPattern and createImageBitmap.
Comment 24 by, Jul 28 2016
Is this supposed to be one of the blocking items:
Comment 25 by, Jul 28 2016
Blockedon: 631825
Good catch.
Comment 26 by, Oct 12 2016
Blockedon: 655177
Comment 27 by, Oct 20 2016
Blockedon: -585607
Comment 28 by, Oct 20 2016
Blockedon: 655278
Blockedon: 655335
Blockedon: 655270
Blockedon: 658251
Comment 32 by, Oct 25 2016
Blockedon: 659260
Comment 33 by, Nov 2 2016
Blockedon: 661605
Comment 34 by, Nov 4 2016
Blockedon: 662498
Blockedon: 663916
Context2D.CanvasCompositing is in the spec. Will it be implemented before launch?
Comment 37 by, Nov 14 2016
Blockedon: 645748
Yes, compositing will be there.  Thanks for pointing it out.
Comment 38 by, Nov 14 2016
Blockedon: 665057
Comment 39 by, Nov 14 2016
Blockedon: 664547
Blockedon: 666024
Comment 41 by, Nov 30 2016
Blockedon: 669392
globalAlpha getter/setter are missing from OffscreenCanvasRenderingContext2D
@#42: Yep globalAlpha just got fix last week:

It should be there in the latest canary build.
Blockedon: 672571
Comment 45 by, Dec 12 2016
Blockedon: 673347
Comment 46 by, Dec 12 2016
Blockedon: 673348
Project Member Comment 47 by, Dec 13 2016
The following revision refers to this bug:

commit 989e9e9435bacdc30620a2718335119791972373
Author: junov <>
Date: Tue Dec 13 19:42:22 2016

Add test to verify that OffscreenCanvas commit() retains canvas contents


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


Comment 48 by, Dec 16 2016
Blockedon: 646864
Comment 49 by, Dec 20 2016
Blockedon: 676131
Comment 50 by, Dec 20 2016
Blockedon: 674744
Comment 51 by, Dec 22 2016
Blockedon: 676666
Comment 52 by, Jan 3 2017
Blockedon: -664547
Labels: M-59
The predictability program is reviewing the top 50 starred Blink bugs this quarter, and this is #50 on that list.

Can someone give a quick summary here of the status of OffscreenCanvas?  I know work is progressing rapidly and we were originally hoping to ship in M58, right?  Is M59 now the target?

Comment 54 by, Mar 23 2017
rbyers@: We finished most of the shipping-blocking issues for OffscreenCanvas. Now we are settling down on a spec discussion with other vendors to change the current commit() API. Once that part of spec is landed in WHATWG, as well as the implementation change + a few more conformance tests to web-platform-tests/WebGL for that change of spec, then we can ship it. I think M59 might be a bit tight a deadline; maybe M60 is a better estimate. junov@: WDYT?
Comment 55 by, Mar 23 2017
Labels: -M-59 M-60
Yeah, we are also dealing several recently discovered bugs. I think pushing to M60 is more realistic at this point. 
Comment 56 by, Mar 23 2017
Blockedon: 696223
Comment 57 by, Mar 23 2017
Blockedon: 696222
Comment 58 by, Mar 23 2017
Blockedon: 585607
Comment 59 by, Mar 23 2017
Blockedon: 697582
Comment 60 by, Mar 23 2017
Blockedon: 703673
Blockedon: 708709
Comment 62 by, Apr 13 2017
Am I right to say that Chrome's implementation of this will enable true offthread GPGPU?
Comment 63 by, Apr 13 2017
If you are satisfied with the OpenGL 2.0 API, then yes, this will give you offthread GPGPU. But if you want compute shaders, then you also need a next gen GPU API for the web, or a WebGL extension that exposes compute shaders.

Not sure what you mean by "true offthread", but keep in mind that the GPU itself is a monolithic resource that can only be doing one thing at a time (though that one thing may be massively parallel). So if you want your web app's UI to be interactive while it is performing a long running GPGPU task in a worker, you will have to break your GPGPU task into small chunks of work so that the GPU can interleave GPGPU work and graphics updates.
Comment 64 by, Apr 13 2017
Sorry, I meant "WebGL 2.0", not "OpenGL 2.0" in my previous comment.
Comment 65 by, Apr 26 2017
Blockedon: 715212
Comment 66 by, Apr 26 2017
Blockedon: 715757
Comment 67 by, Apr 27 2017
Blockedon: 716091
Comment 68 by, Apr 27 2017
Blockedon: 716138
Apologies if this is too off-topic, but it seems relevant to the OffscreenCanvas feature.

I've got a use case where I generate a lot of SVGs and render them to a canvas for further manipulation and extraction of ImageData. Currently this is bottlenecked on the main thread since each SVG being rendered takes ~80ms.

The only way I know of at the moment in M58 to render these SVGs is to create a Blob of the XML representation with type "image/svg+xml;charset=utf-8", then create a URL for the Blob, set the URL as the source for an Image, and after onload is finished draw the image to a CanvasRenderingContext2D.

With the work here on OffscreenCanvas will the rendering of an SVG be possible in a worker? Clearly the drawing to the canvas and further manipulation could be done in a worker thread once OffscreenCanvas is complete, but I haven't seen anything to suggest that the SVG rendering could be as well? Image is not available in the worker context, and attempting to do the rendering using createImageBitmap complains that the source Blob can't be decoded.
@69 See issue 606317
Blockedon: 718509
@69: OffscreenCanvas on its own does not completely solve the problem.  The issue pointed out in @70 is the missing link. Since DOM elements are not allowed to exist in workers the SVG cannot be loaded via HTMLImageElement. Instead we need to go through ImageBitmap. That is what issue 606317 is about.
Blockedon: 730643
Blockedon: 720188
Comment 75 by, Jun 20 2017
Blockedon: 735029
Comment 76 by, Jun 21 2017
Blockedon: 735228
Comment 77 by, Jun 21 2017
Blockedon: 735470
Comment 78 by, Jul 27 2017
Blockedon: 736022
Blockedon: 754733
Blockedon: 754736
Blockedon: 753483
Blockedon: 762647
Blockedon: 773045
Blockedon: -773045
Blockedon: 778889
Blockedon: 792506
Blockedon: 803075
Labels: Hotlist-GoogleApps-P1 Hotlist-GoogleApps
Labels: -Hotlist-GoogleApps-P1
Blockedon: 803937
Labels: -M-60
Blockedon: 803941
Sign in to add a comment