canvas: Make OffscreenCanvas transferable (without placeholder)#37872
canvas: Make OffscreenCanvas transferable (without placeholder)#37872gterzian merged 1 commit intoservo:mainfrom
Conversation
|
This is groundwork for transferrable OffscreenCanvas objects. For case with existed placeholder canvas need to much more work... |
f037e23 to
1a2021a
Compare
|
Fixed clippy error (the entire enum is at least 472 bytes) for |
|
🔨 Triggering try run (#16071875742) for Linux (WPT) |
|
Test results for linux-wpt from try job (#16071875742): Flaky unexpected result (18)
Stable unexpected results that are known to be intermittent (25)
|
|
✨ Try run (#16071875742) succeeded. |
There was a problem hiding this comment.
Good initial PR toward the transfer of an offscreen canvas; please document the TODOs and open an issue for a follow-up
The transferring of width, height looks good to me, and for the transfer usecase to work, which is this example, we'd have to maintain the relationship with the placeholder element(which is done via dataHolder.[[PlaceholderCanvas]] in the spec). Implementing the equivalent of dataHolder.[[PlaceholderCanvas]] is likely to involve some IPC with the rendering backend. cc @sagudev
1a2021a to
9f12161
Compare
9f12161 to
18b7be4
Compare
|
|
🔨 Triggering try run (#16110916375) for Linux (WPT) |
|
Test results for linux-wpt from try job (#16110916375): Flaky unexpected result (20)
Stable unexpected results that are known to be intermittent (25)
Stable unexpected results (1)
|
|
|
|
Failed WPT test is not relevant to OffscreenCanvas (looks like - #36500): |
|
🔨 Triggering try run (#16116853016) for Linux (WPT) |
|
Test results for linux-wpt from try job (#16116853016): Flaky unexpected result (14)
Stable unexpected results that are known to be intermittent (17)
|
|
✨ Try run (#16116853016) succeeded. |
gterzian
left a comment
There was a problem hiding this comment.
LGTM with a couple of last comments to address before merging.
components/shared/constellation/structured_data/transferable.rs
Outdated
Show resolved
Hide resolved
61499bb to
b7b8579
Compare
|
Good to go, thanks @tharkum |
b7b8579 to
30af7e0
Compare
|
@gterzian < Made mistake when moved Did local testing for failed WPT tests - they should pass now |
|
🔨 Triggering try run (#16140534984) for Linux (WPT) |
Follow the specification and make OffscreenCanvas objects are transferable, but not in case if there are a weak reference to placeholder canvas element. To handle it properly need to implement dedicated frame provider/dispatcher between canvas element (script thread) and offscreen canvas (dedicated worker thread). https://html.spec.whatwg.org/multipage/#the-offscreencanvas-interface:transferable-objects Testing: Improvements in the following tests - html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.detachedcanvas.html - html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob* - html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer* - html/infrastructure/safe-passing-of-structured-data/transfer-errors.window.js Fixes (partially): servo#24276 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
30af7e0 to
3d355c8
Compare
|
Fixed clippy warning (as error) |
|
Test results for linux-wpt from try job (#16140534984): Flaky unexpected result (18)
Stable unexpected results that are known to be intermittent (18)
|
|
✨ Try run (#16140534984) succeeded. |
Follow the specification and make OffscreenCanvas objects are transferable,
but not in case if there are a weak reference to placeholder canvas element.
To handle it properly need to implement dedicated frame provider/dispatcher
between canvas element (script thread) and offscreen canvas (dedicated worker thread).
https://html.spec.whatwg.org/multipage/#the-offscreencanvas-interface:transferable-objects
Testing: Improvements in the following tests
Part of #24276