-
Notifications
You must be signed in to change notification settings - Fork 685
Open
Description
(To be clear I don't think this is very important, but I wrote a test case so I wanted to share it here - maybe someday it will matter enough to someone to iron out.)
transferToImageBitmap() can be called on OffscreenCanvases which are actually on-screen via transferControlToOffscreen(). Thus the compositor and transferToImageBitmap() can both try to take frames from the canvas.
Here's a sample page: https://codepen.io/kainino0x/pen/dyxoNRd
It raises issues like:
- It's probably not tested that
preserveDrawingBufferdoesn't apply totransferToImageBitmap(chrome gets this wrong) - It's unclear what should happen when calling
transferToImageBitmapon a canvas that haspreserveDrawingBuffer: falseafter it has been presented (get the presented canvas's contents? get nothing and clear the presented canvas? get nothing but leave up the presented canvas?) - Should
transferToImageBitmap()really work at all withtransferControlToOffscreen()? Would be curious to see if any websites do that.
BTW in various browsers some of the canvas images will eventually "expire" if left in the background for long enough, which AFAIU is intended to be allowed with preserveDrawingBuffer: false but maybe not otherwise.
Metadata
Metadata
Assignees
Labels
No labels