Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add naive implementation of
beginWebGPUAccess
.
Explainer: https://github.com/fserb/canvas2D/blob/master/spec/webgpu.md This API converts a canvas' currently-displayed image to a GPUTexture which can be used by WebGPU. At present, the current implementation uses Snapshot(), which always clones the image. An ideal design would avoid this copy, but this gives us a starting point to iterate from. We do not yet have any guards against continuing to use the Canvas2D APIs after calling `beginWebGPUAccess`. This is safe because we don't actually steal the existing texture away from the canvas; it still has its own storage, distinct from the WebGPU texture. Once `endWebGPUAccess` is implemented, it is expected that this would clobber any canvas changes that might have occurred during WebGPU access (as the canvas texture would be replaced by the GPUTexture from WebGPU). Change-Id: Ied046431fbfdfff673ae61280317f8e0931ece7e Bug: 41490345 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5289055 Reviewed-by: Austin Eng <[email protected]> Reviewed-by: Jean-Philippe Gravel <[email protected]> Reviewed-by: Vasiliy Telezhnikov <[email protected]> Auto-Submit: John Stiles <[email protected]> Commit-Queue: John Stiles <[email protected]> Cr-Commit-Position: refs/heads/main@{#1275839}
- Loading branch information