diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-11-14 09:12:34 +0100 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-11-26 11:23:13 +0100 |
commit | fa27a59ec3cfc173d5ff202feb23e8b6e398dac9 (patch) | |
tree | a34f7a199611118e826a029a5bebf93f9425b32d /src/plugins/platforms/wasm/qwasmaccessibility.cpp | |
parent | c675c1c56d3c00b3c1de5aee8c7c6f7eeeb70bc1 (diff) |
Use the browser compositor for drawing windows on WASM
Make the browser compositor draw the window non-client area (using css
+ html). Get rid of OpenGL usage in non-OpenGL windows and use canvas
2d context instead to blit the texture (QImage).
Also, as part of the change, remove the deprecated canvas element support
in QScreen.
Fixes: QTBUG-107116
Fixes: QTBUG-107219
Change-Id: I65f0d91831c806315685ca681ac0e416673f5cd5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmaccessibility.cpp')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmaccessibility.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/wasm/qwasmaccessibility.cpp b/src/plugins/platforms/wasm/qwasmaccessibility.cpp index 75e5b0a674..eb3e30b140 100644 --- a/src/plugins/platforms/wasm/qwasmaccessibility.cpp +++ b/src/plugins/platforms/wasm/qwasmaccessibility.cpp @@ -38,7 +38,7 @@ emscripten::val QWasmAccessibility::getContainer(QAccessibleInterface *iface) QWasmScreen *screen = QWasmScreen::get(window->screen()); if (!screen) return emscripten::val::undefined(); - return screen->container(); + return screen->element(); } emscripten::val QWasmAccessibility::getDocument(const emscripten::val &container) @@ -142,11 +142,12 @@ void QWasmAccessibility::setHtmlElementGeometry(QAccessibleInterface *iface) void QWasmAccessibility::setHtmlElementGeometry(QAccessibleInterface *iface, emscripten::val element) { // Position the element using "position: absolute" in order to place - // it under the corresponding Qt element on the canvas. + // it under the corresponding Qt element in the screen. QRect geometry = iface->rect(); emscripten::val style = element["style"]; style.set("position", std::string("absolute")); - style.set("z-index", std::string("-1")); // FIXME: "0" should be sufficient to order beheind the canvas, but isn't + style.set("z-index", std::string("-1")); // FIXME: "0" should be sufficient to order beheind the + // screen element, but isn't style.set("left", std::to_string(geometry.x()) + "px"); style.set("top", std::to_string(geometry.y()) + "px"); style.set("width", std::to_string(geometry.width()) + "px"); |