merge_pr_42544
版本发布时间: 2023-10-20 21:41:12
web-platform-tests/wpt最新发布版本:merge_pr_48029(2024-09-07 13:25:31)
Throw an exception in transferToImageBitmap if canvas layers are opened
This API is incompatible with how the 2D canvas is rasterized when it contains unclosed layers. Because layers can have filters that get applied on their final content, they can't be presented until they are closed. Instead, we normally keep the layer content alive after a flush, so that it can be presented in a later frame when the layer is finally closed.
OffscreenCanvas.transferToImageBitmap however is supposed to release the canvas content, leaving the offscreen canvas empty. We cannot release the recording if layers are incomplete, and if we kept the layer content alive for later, we would not be leaving the canvas empty as the spec requires.
This behavior is part of the current 2D Canvas Layer spec draft: Explainer: https://github.com/fserb/canvas2D/blob/master/spec/layers.md Spec draft: https://github.com/whatwg/html/pull/9537
Bug: 1484741 Change-Id: Ic770b51a0343faf0b2c7477624d69f59187ce97f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4939633 Commit-Queue: Jean-Philippe Gravel jpgravel@chromium.org Reviewed-by: Fernando Serboncini fserb@chromium.org Cr-Commit-Position: refs/heads/main@{#1212692}
1、 MANIFEST-3375400712353d2c9b011ed3dbb24c8d756b784f.json.bz2 2.34MB
2、 MANIFEST-3375400712353d2c9b011ed3dbb24c8d756b784f.json.gz 2.87MB
3、 MANIFEST-3375400712353d2c9b011ed3dbb24c8d756b784f.json.zst 2.33MB