qt: allow enforcing compositor and preliminary support for wasm video integration through `CompositorPlatform`
I have not tested the Wasm video integration yet, but since Qt 6.5 Wasm platform plugin patch Use the browser compositor for drawing windows on WASM
(https://codereview.qt-project.org/c/qt/qtbase/+/437285) we should be able to have video embedding with Wasm.
The build system needs adjustment to test it, so it is only used when CompositorPlatform
is enforced via --qt-compositor=platform
. I don't know how much change the build system needs for Qt at the moment, I'm really not familiar with the build system. It seems (https://github.com/qt/qtbase/blob/059210b17e50fd7c45af4ca0631ddcf8dd7c67f8/src/corelib/Qt6WasmMacros.cmake#L80) that we at least need to copy qtloader.js
.
Previously in !5542 (merged), we already started to use the Qt Wasm platform plugin when __EMSCRIPTEN__
is defined.
I have taken a look at https://code.videolan.org/jbk/vlc.js to see what the wasm "window" would need. I initially thought that it would be a DOM canvas, but turns out it is a GL context. I'm not sure how it is supposed to handle resize that way, but in the future we can change it.
Similar to wasm
, wayland
and xcb
can also be enforced with --qt-compositor=platform
. They are not used by default, since there is already CompositorWayland
for Wayland, and there is no support for child window transparency with xcb
(Qt with xcb native painting feature and QQuickWidget
might be necessary to support that. Currently, with Qt 6.8 and KWin X11 OpenGL backend there is no support).
Request review @chub.