If I am understanding this correctly, we actually may need a bunch of related but independent changes to solve this: 1) Create/implement `GPUCanvasImage`, which works similarly to `GPUVideoImage`, except the compositor process remote canvases are the producers, and `PCanvasManager` would facilitate readback of the pixels for the content process. We would need to teach the display pipeline to handle this as well, again, similar to `GPUVideoImage`. 2) Make WebGL produce a `GPUCanvasImage` for back buffer readbacks, which is how `ImageBitmap` is produced from a WebGL context today. 3) Make WebGL handle `SurfaceDescriptor` for `GPUCanvasImage` on its texture upload path. 4) Make WebGL handle `ImageBitmap` without readback if possible, using the same `SurfaceDescriptor` plumbing we have today. This will improve performance for platform-specific hardware texture backed `ImageBitmap` objects with WebGL, including the new `GPUCanvasImage`. 5) Override `nsICanvasRenderingContextInternal::GetFrontBuffer` for `ImageBitmapRenderingContext` to allow us to present using a `SurfaceDescriptor` for when it is backed by `GPUCanvasImage` (or anything else supporting `SurfaceDescriptor` for that matter).
Bug 1788206 Comment 14 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
If I am understanding this correctly, we actually may need a bunch of related but independent changes to solve this: 1) Create/implement `GPUCanvasImage`, which works similarly to `GPUVideoImage` in that it is often backed by a platform-specific hardware texture, except the compositor process remote canvases are the producers, and `PCanvasManager` would facilitate readback of the pixels for the content process. We would need to teach the display pipeline to handle this as well, again, similar to `GPUVideoImage`. 2) Make WebGL produce a `GPUCanvasImage` for back buffer readbacks, which is how `ImageBitmap` is produced from a WebGL context today. 3) Make WebGL handle `SurfaceDescriptor` for `GPUCanvasImage` on its texture upload path. 4) Make WebGL handle `ImageBitmap` without readback if possible, using the same `SurfaceDescriptor` plumbing we have today. This will improve performance for platform-specific hardware texture backed `ImageBitmap` objects with WebGL, including the new `GPUCanvasImage`. 5) Override `nsICanvasRenderingContextInternal::GetFrontBuffer` for `ImageBitmapRenderingContext` to allow us to present using a `SurfaceDescriptor` for when it is backed by `GPUCanvasImage` (or anything else supporting `SurfaceDescriptor` for that matter).