MyGit

merge_pr_42662

web-platform-tests/wpt

版本发布时间: 2023-10-20 23:21:15

web-platform-tests/wpt最新发布版本:merge_pr_48029(2024-09-07 13:25:31)

Throw an exception in putImageData 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.

putImageData however is supposed to write to the canvas bitmap wholesale, bypassing all render states. This means that we can't write to the layer's content because the written pixels would then get filtered when the layer is closed. We can't write to the main canvas either because these pixels would later be overwritten by the layer's result with draw calls that potentially happened before (e.g. in the sequence beginLayer(); fillRect(); putImageData(); endLayer();, fillRect() would write over putImageData().

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

Change-Id: I266a3155c32919a68dbbb093e4aff9b1dd13a3b5 Bug: 1484741 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4943172 Reviewed-by: Fernando Serboncini fserb@chromium.org Commit-Queue: Jean-Philippe Gravel jpgravel@chromium.org Cr-Commit-Position: refs/heads/main@{#1212741}

相关地址:原始地址 下载(tar) 下载(zip)

1、 MANIFEST-6e6f9fbb0746983001d7fe80ab717567c2f73bfc.json.bz2 2.34MB

2、 MANIFEST-6e6f9fbb0746983001d7fe80ab717567c2f73bfc.json.gz 2.87MB

3、 MANIFEST-6e6f9fbb0746983001d7fe80ab717567c2f73bfc.json.zst 2.34MB

查看:2023-10-20发行的版本