diff options
| author | Morten Johan Sørvig <[email protected]> | 2019-05-08 09:23:52 +0200 |
|---|---|---|
| committer | Morten Johan Sørvig <[email protected]> | 2022-01-05 21:25:38 +0100 |
| commit | eb62b6ac02b86f11bc6bcbe1f37df003d2a46d02 (patch) | |
| tree | aad695a330fed62248e9307e6c402be265739c59 /src/plugins/platforms/wasm/qwasmscreen.cpp | |
| parent | e3e2674100b1ecbad7117f15c7aa13a704a7d34e (diff) | |
wasm: always use requestAnimationFrame for updates
The compositor was posting update events and flushing/redrawing
using a zero-timer. Change this to use the request_animation_frame
API from Emscripten, which makes sure we flush window
content at the next native paint event.
This has the additional benefit that hidden canvases
(e.g on hidden tabs) won’t get frame events, and then
stop painting.
We support both well-behaved QWindows, where the window
calls requestUpate() and then paints/flushes on the
following deliverUpdateRequest(), and also less well
behaved windows which paints at any point during event
processing.
Pick-to: 6.3
Change-Id: I747d6f7ace86ceddaa18ab86b6a0ee833f98991b
Reviewed-by: Lorn Potter <[email protected]>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmscreen.cpp')
| -rw-r--r-- | src/plugins/platforms/wasm/qwasmscreen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmscreen.cpp b/src/plugins/platforms/wasm/qwasmscreen.cpp index 0b11415fd3a..3cc067bbe78 100644 --- a/src/plugins/platforms/wasm/qwasmscreen.cpp +++ b/src/plugins/platforms/wasm/qwasmscreen.cpp @@ -216,7 +216,7 @@ void QWasmScreen::updateQScreenAndCanvasRenderSize() QPoint position(rect["left"].as<int>() - offset.x(), rect["top"].as<int>() - offset.y()); setGeometry(QRect(position, cssSize.toSize())); - m_compositor->redrawWindowContent(); + m_compositor->requestUpdateAllWindows(); } void QWasmScreen::canvasResizeObserverCallback(emscripten::val entries, emscripten::val) |
