diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2017-12-01 15:50:30 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2018-01-04 20:15:52 +0000 |
commit | 62d07125620e787e7461edc5cfd4aa4287f26847 (patch) | |
tree | ced38f7a6c4c6976c8d31d31001691d12e029ab6 /src/quick | |
parent | 1dbe0acecbc286b6df25fe2a9c4a373fa0d6b11e (diff) |
wasm: get declarative building and running for webassembly
One thread
Change-Id: Iab9bd20eb5951c7b0fe0b6f48f1f14ea7560d8f7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickwindowattached.cpp | 1 | ||||
-rw-r--r-- | src/quick/items/qquickwindowmodule_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontextplugin.cpp | 5 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 3 |
5 files changed, 9 insertions, 4 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index caae188ed8..462790e1b1 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -532,6 +532,8 @@ void QQuickWindowPrivate::init(QQuickWindow *c, QQuickRenderControl *control) Q_Q(QQuickWindow); + qRegisterMetaType<QWindow::Visibility>(); + contentItem = new QQuickRootItem; QQml_setParent_noEvent(contentItem, c); QQmlEngine::setObjectOwnership(contentItem, QQmlEngine::CppOwnership); diff --git a/src/quick/items/qquickwindowattached.cpp b/src/quick/items/qquickwindowattached.cpp index ae62a7a496..d3835ed45c 100644 --- a/src/quick/items/qquickwindowattached.cpp +++ b/src/quick/items/qquickwindowattached.cpp @@ -116,7 +116,6 @@ void QQuickWindowAttached::windowChange(QQuickWindow *window) if (!window) return; - // QQuickWindowQmlImpl::visibilityChanged also exists, and window might even // be QQuickWindowQmlImpl, but that's not what we are connecting to. // So this is actual window state rather than a buffered or as-requested one. diff --git a/src/quick/items/qquickwindowmodule_p.h b/src/quick/items/qquickwindowmodule_p.h index e7033e9b8d..4a6f315d58 100644 --- a/src/quick/items/qquickwindowmodule_p.h +++ b/src/quick/items/qquickwindowmodule_p.h @@ -58,6 +58,8 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_METATYPE(QWindow::Visibility) + class QQuickWindowQmlImplPrivate; class Q_QUICK_PRIVATE_EXPORT QQuickWindowQmlImpl : public QQuickWindow, public QQmlParserStatus diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp index 6583883d0c..1c2550d197 100644 --- a/src/quick/scenegraph/qsgcontextplugin.cpp +++ b/src/quick/scenegraph/qsgcontextplugin.cpp @@ -137,9 +137,10 @@ QSGAdaptationBackendData *contextFactory() && !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) { requestedBackend = QString::fromLocal8Bit("software"); } - +#ifdef Q_OS_HTML5 + requestedBackend = QString::fromLocal8Bit("software"); +#endif if (!requestedBackend.isEmpty()) { - qCDebug(QSG_LOG_INFO) << "Loading backend" << requestedBackend; // First look for a built-in adaptation. for (QSGContextFactoryInterface *builtInBackend : qAsConst(backendData->builtIns)) { diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 88899c400c..04c19a5501 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -201,6 +201,8 @@ QSGRenderLoop *QSGRenderLoop::instance() loopType = ThreadedRenderLoop; else loopType = WindowsRenderLoop; +#elif defined(Q_OS_HTML5) + loopType = BasicRenderLoop; #else if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)) loopType = ThreadedRenderLoop; @@ -406,7 +408,6 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) if (profileFrames) renderTimer.start(); Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphPolishFrame); - cd->polishItems(); if (profileFrames) |