OffscreenCanvas flickers with calling getContext('2d')
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
People
(Reporter: n8agrin, Assigned: n8agrin)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Steps to reproduce:
- create a canvas element
- pass canvas element to worker via canvas.transferControlToOffscreen()
- in worker, call getContext('2d') on some interval
- !! note the canvas briefly flashes coinciding with the getContext('2d') call
Trivial repro case is here: https://www.nate.surf/firefox-offscreen-canvas-bug/
- worker.js https://www.nate.surf/firefox-offscreen-canvas-bug/worker.js
- main.js https://www.nate.surf/firefox-offscreen-canvas-bug/main.js
Actual results:
canvas flickers or flashes on each getContext('2d') call.
Expected results:
canvas should not flicker.
Please note, this flicker blocks us from being able to depend on Firefox when rendering data-dense visualizations. We need to access the canvas' context to calculate pointer intersections, for example, which creates a significant flashing or strobing effect. At the moment we cannot recommend Firefox to some of our users because of this issue.
Possibly related issues:
Comment 2•1 day ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Graphics: Canvas2D' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
When getContext() is called multiple times on an OffscreenCanvas transferred via
transferControlToOffscreen(), it was creating a new ImageContainer each time,
causing the canvas to flicker. This fix only calls UpdateContext() when a context
is newly created, not when returning an existing context.
Updated•1 day ago
|
Description
•