7#include <qpa/qwindowsysteminterface.h>
9#include <emscripten/html5.h>
20 if (m_requestAnimationFrameId != -1)
21 emscripten_cancel_animation_frame(m_requestAnimationFrameId);
33 return !element->context2d().isUndefined();
47 if (
it == m_requestUpdateWindows.
end()) {
60void QWasmCompositor::requestUpdate()
62 if (m_requestAnimationFrameId != -1)
65 static auto frame = [](
double frameTime,
void *
context) ->
int {
75 m_requestAnimationFrameId = emscripten_request_animation_frame(
frame,
this);
78void QWasmCompositor::deliverUpdateRequests()
83 auto requestUpdateWindows = m_requestUpdateWindows;
84 m_requestUpdateWindows.
clear();
89 m_inDeliverUpdateRequest =
true;
93 deliverUpdateRequest(
window, updateType);
96 m_inDeliverUpdateRequest =
false;
97 frame(requestUpdateWindows.keys());
100void QWasmCompositor::deliverUpdateRequest(
QWasmWindow *
window, UpdateRequestDeliveryType updateType)
109 if (qwindow->isExposed() ==
false)
111 window->deliverUpdateRequest();
121 if (!m_inDeliverUpdateRequest)
127 if (!m_isEnabled || !
screen())
iterator insert(const Key &key, const T &value)
size_type remove(const Key &key)
iterator find(const Key &key)
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr QSize size() const noexcept
Returns the size of the rectangle.
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
void onWindowTreeChanged(QWasmWindowTreeNodeChangeType changeType, QWasmWindow *window)
void setEnabled(bool enabled)
void requestUpdateWindow(QWasmWindow *window, UpdateRequestDeliveryType updateType=ExposeEventDelivery)
void handleBackingStoreFlush(QWindow *window)
UpdateRequestDeliveryType
QWasmCompositor(QWasmScreen *screen)
QList< QWasmWindow * > allWindows()
static void setSynchronousWindowSystemEvents(bool enable)
static bool handleExposeEvent(QWindow *window, const QRegion ®ion)
QSet< QString >::iterator it
static QOpenGLCompositor * compositor
GLenum GLenum GLsizei const GLuint GLboolean enabled
QWasmWindowTreeNodeChangeType