aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/masm/wtf/Platform.h1
-rw-r--r--src/imports/shapes/qquickshapegenericrenderer.cpp9
-rw-r--r--src/plugins/plugins.pro2
-rw-r--r--src/qml/animations/qabstractanimationjob.cpp3
-rw-r--r--src/qml/jsruntime/qv4executableallocator_p.h5
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp2
-rw-r--r--src/qml/qml/ftw/qqmlthread.cpp19
-rw-r--r--src/qml/qml/qqmlimport.cpp11
-rw-r--r--src/qml/qml/qqmltypeloader.cpp29
-rw-r--r--src/qml/qml/v8/qv8engine.cpp2
-rw-r--r--src/qml/qtqmlglobal.h2
-rw-r--r--src/qml/util/qqmlchangeset.cpp2
-rw-r--r--src/quick/items/qquickflickable.cpp3
-rw-r--r--src/quick/items/qquickwindow.cpp2
-rw-r--r--src/quick/items/qquickwindowattached.cpp1
-rw-r--r--src/quick/items/qquickwindowmodule_p.h2
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp13
-rw-r--r--src/quick/scenegraph/scenegraph.pri1
18 files changed, 88 insertions, 21 deletions
diff --git a/src/3rdparty/masm/wtf/Platform.h b/src/3rdparty/masm/wtf/Platform.h
index 4f37245495..a81ef4589a 100644
--- a/src/3rdparty/masm/wtf/Platform.h
+++ b/src/3rdparty/masm/wtf/Platform.h
@@ -157,6 +157,7 @@
|| defined(_M_IX86) \
|| defined(_X86_) \
|| defined(__THW_INTEL)
+
#define WTF_CPU_X86 1
#endif
diff --git a/src/imports/shapes/qquickshapegenericrenderer.cpp b/src/imports/shapes/qquickshapegenericrenderer.cpp
index 8a4785a83a..e3d47430c7 100644
--- a/src/imports/shapes/qquickshapegenericrenderer.cpp
+++ b/src/imports/shapes/qquickshapegenericrenderer.cpp
@@ -278,6 +278,7 @@ void QQuickShapeGenericRenderer::setAsyncCallback(void (*callback)(void *), void
m_asyncCallbackData = data;
}
+#ifndef QT_NO_THREAD
static QThreadPool *pathWorkThreadPool = nullptr;
static void deletePathWorkThreadPool()
@@ -285,6 +286,7 @@ static void deletePathWorkThreadPool()
delete pathWorkThreadPool;
pathWorkThreadPool = nullptr;
}
+#endif
void QQuickShapeGenericRenderer::endSync(bool async)
{
@@ -311,13 +313,14 @@ void QQuickShapeGenericRenderer::endSync(bool async)
continue;
}
+#ifndef QT_NO_THREAD
if (async && !pathWorkThreadPool) {
qAddPostRoutine(deletePathWorkThreadPool);
pathWorkThreadPool = new QThreadPool;
const int idealCount = QThread::idealThreadCount();
pathWorkThreadPool->setMaxThreadCount(idealCount > 0 ? idealCount * 2 : 4);
}
-
+#endif
if ((d.syncDirty & DirtyFillGeom) && d.fillColor.a) {
d.path.setFillRule(d.fillRule);
if (m_api == QSGRendererInterface::Unknown)
@@ -348,7 +351,9 @@ void QQuickShapeGenericRenderer::endSync(bool async)
r->deleteLater();
});
didKickOffAsync = true;
+#ifndef QT_NO_THREAD
pathWorkThreadPool->start(r);
+#endif
} else {
triangulateFill(d.path, d.fillColor, &d.fillVertices, &d.fillIndices, &d.indexType, q_supportsElementIndexUint(m_api));
}
@@ -376,7 +381,9 @@ void QQuickShapeGenericRenderer::endSync(bool async)
r->deleteLater();
});
didKickOffAsync = true;
+#ifndef QT_NO_THREAD
pathWorkThreadPool->start(r);
+#endif
} else {
triangulateStroke(d.path, d.pen, d.strokeColor, &d.strokeVertices,
QSize(m_item->width(), m_item->height()));
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 0afd71767e..d3a8a17cf7 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
QT_FOR_CONFIG += qml
-qtConfig(qml-debug):SUBDIRS += qmltooling
+!emacsripten:qtConfig(qml-debug):SUBDIRS += qmltooling
qtHaveModule(quick):SUBDIRS += scenegraph
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp
index 3f33e7e81b..2bb5766c7b 100644
--- a/src/qml/animations/qabstractanimationjob.cpp
+++ b/src/qml/animations/qabstractanimationjob.cpp
@@ -78,7 +78,8 @@ QQmlAnimationTimer *QQmlAnimationTimer::instance(bool create)
inst = animationTimer() ? animationTimer()->localData() : 0;
}
#else
- static QAnimationTimer unifiedTimer;
+ Q_UNUSED(create)
+ static QQmlAnimationTimer unifiedTimer;
inst = &unifiedTimer;
#endif
return inst;
diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h
index 375c9a365f..19eaed8723 100644
--- a/src/qml/jsruntime/qv4executableallocator_p.h
+++ b/src/qml/jsruntime/qv4executableallocator_p.h
@@ -100,9 +100,14 @@ public:
bool mergeNext(ExecutableAllocator *allocator);
bool mergePrevious(ExecutableAllocator *allocator);
+#ifndef QT_NO_BITFIELDS
quintptr addr = 0;
uint size : 31; // More than 2GB of function code? nah :)
uint free : 1;
+#else
+ uint size = 31; // More than 2GB of function code? nah :)
+ uint free = 1;
+#endif
Allocation *next = nullptr;
Allocation *prev = nullptr;
};
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index e73365e9b1..6adb25f964 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -995,7 +995,7 @@ QV4::ReturnedValue VME::exec(const FunctionObject *fo, const Value *thisObject,
MOTH_BEGIN_INSTR(Construct)
STORE_IP();
- acc = Runtime::method_construct(engine, STACK_VALUE(func), stack + argv, argc);
+ acc = Runtime::method_construct(engine, STACK_VALUE(func), stack + argv, argc);
CHECK_EXCEPTION;
MOTH_END_INSTR(Construct)
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp
index 96313d7627..9c44e18b87 100644
--- a/src/qml/qml/ftw/qqmlthread.cpp
+++ b/src/qml/qml/ftw/qqmlthread.cpp
@@ -106,6 +106,9 @@ void QQmlThreadPrivate::triggerMainEvent()
{
Q_ASSERT(q->isThisThread());
QCoreApplication::postEvent(&m_mainObject, new QEvent(QEvent::User));
+#ifdef Q_OS_HTML5
+ QCoreApplication::processEvents();
+#endif
}
// Trigger even in thread. Must be called from main thread.
@@ -113,6 +116,9 @@ void QQmlThreadPrivate::triggerThreadEvent()
{
Q_ASSERT(!q->isThisThread());
QCoreApplication::postEvent(this, new QEvent(QEvent::User));
+#ifdef Q_OS_HTML5
+ QCoreApplication::processEvents();
+#endif
}
bool QQmlThreadPrivate::MainObject::event(QEvent *e)
@@ -322,11 +328,16 @@ void QQmlThread::internalCallMethodInThread(Message *message)
bool wasEmpty = d->threadList.isEmpty();
d->threadList.append(message);
+
+#ifdef QT_NO_THREAD
+ d->mainSync = message;
+#endif
if (wasEmpty && d->m_threadProcessing == false)
d->triggerThreadEvent();
- d->m_mainThreadWaiting = true;
+#ifndef QT_NO_THREAD
+ d->m_mainThreadWaiting = true;
do {
if (d->mainSync) {
QQmlThread::Message *message = d->mainSync;
@@ -340,7 +351,7 @@ void QQmlThread::internalCallMethodInThread(Message *message)
d->wait();
}
} while (d->mainSync || !d->threadList.isEmpty());
-
+#endif
d->m_mainThreadWaiting = false;
d->unlock();
}
@@ -402,8 +413,10 @@ void QQmlThread::waitForNextMessage()
d->lock();
Q_ASSERT(d->m_mainThreadWaiting == false);
+#ifdef QT_NO_THREAD
+ d->triggerThreadEvent();
+#endif
d->m_mainThreadWaiting = true;
-
if (d->mainSync || !d->threadList.isEmpty()) {
if (d->mainSync) {
QQmlThread::Message *message = d->mainSync;
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 005db4248e..fe7e5d5a33 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1280,7 +1280,6 @@ bool QQmlImportsPrivate::locateQmldir(const QString &uri, int vmaj, int vmin, QQ
QQmlAbstractUrlInterceptor *interceptor = typeLoader.engine()->urlInterceptor();
QStringList localImportPaths = database->importPathList(
interceptor ? QQmlImportDatabase::LocalOrRemote : QQmlImportDatabase::Local);
-
// Search local import paths for a matching version
const QStringList qmlDirPaths = QQmlImports::completeQmldirPaths(uri, localImportPaths, vmaj, vmin);
for (QString qmldirPath : qmlDirPaths) {
@@ -1756,10 +1755,16 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
{
filePluginPath << QLatin1String(".");
// Search order is applicationDirPath(), qrc:/qt-project.org/imports, $QML2_IMPORT_PATH, QLibraryInfo::Qml2ImportsPath
+#ifdef Q_OS_HTML5
+ // Hardcode the qml imports to "qml/" relative to the app nexe.
+ // This should perhaps be set via Qml2Imports in qt.conf.
+ QString installImportsPath = QStringLiteral("qml/");
- QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
- addImportPath(installImportsPath);
+#else
+ QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+#endif
+ addImportPath(installImportsPath);
// env import paths
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 5572fdad44..ed742c3681 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -495,8 +495,9 @@ The setError() method may only be called from within a QQmlDataBlob callback.
*/
void QQmlDataBlob::addDependency(QQmlDataBlob *blob)
{
+#ifndef Q_OS_HTML5
ASSERT_CALLBACK();
-
+#endif
Q_ASSERT(status() != Null);
if (!blob ||
@@ -1004,7 +1005,12 @@ struct StaticLoader {
void loadThread(QQmlTypeLoader *loader, QQmlDataBlob *blob) const
{
+#ifdef QT_NO_THREAD
+ loader->m_thread->loadWithStaticDataAsync(blob, data);
+ return;
+#else
loader->loadWithStaticDataThread(blob, data);
+#endif
}
void load(QQmlTypeLoader *loader, QQmlDataBlob *blob) const
{
@@ -1041,8 +1047,9 @@ void QQmlTypeLoader::doLoad(const Loader &loader, QQmlDataBlob *blob, Mode mode)
qWarning("QQmlTypeLoader::doLoad(%s): %s thread", qPrintable(blob->urlString()),
m_thread->isThisThread()?"Compile":"Engine");
#endif
- blob->startLoading();
-
+#ifdef QT_NO_THREAD
+ mode = Asynchronous;
+#endif
if (m_thread->isThisThread()) {
unlock();
loader.loadThread(this, blob);
@@ -1681,7 +1688,7 @@ QQmlTypeData *QQmlTypeLoader::getType(const QUrl &url, Mode mode)
} else if ((mode == PreferSynchronous || mode == Synchronous) && QQmlFile::isSynchronous(url)) {
// this was started Asynchronous, but we need to force Synchronous
// completion now (if at all possible with this type of URL).
-
+#ifndef QT_NO_THREAD
if (!m_thread->isThisThread()) {
// this only works when called directly from the UI thread, but not
// when recursively called on the QML thread via resolveTypes()
@@ -1692,6 +1699,7 @@ QQmlTypeData *QQmlTypeLoader::getType(const QUrl &url, Mode mode)
lock();
}
}
+#endif
}
typeData->addref();
@@ -1705,6 +1713,9 @@ QQmlTypeData will not be cached.
*/
QQmlTypeData *QQmlTypeLoader::getType(const QByteArray &data, const QUrl &url, Mode mode)
{
+#ifdef QT_NO_THREAD
+ mode = Asynchronous;
+#endif
LockHolder<QQmlTypeLoader> holder(this);
QQmlTypeData *typeData = new QQmlTypeData(url, this);
@@ -1749,10 +1760,14 @@ Returns a QQmlQmldirData for \a url. The QQmlQmldirData may be cached.
*/
QQmlQmldirData *QQmlTypeLoader::getQmldir(const QUrl &url)
{
+#ifdef Q_OS_HTML5
+ // ### asserts here on urls like "qml/QtQuick.2.1/qmldir",
+ // which are relative urls we want to load over the network.
+#else
Q_ASSERT(!url.isRelative() &&
(QQmlFile::urlToLocalFileOrQrc(url).isEmpty() ||
!QDir::isRelativePath(QQmlFile::urlToLocalFileOrQrc(url))));
-
+#endif
LockHolder<QQmlTypeLoader> holder(this);
QQmlQmldirData *qmldirData = m_qmldirCache.value(url);
@@ -2426,10 +2441,10 @@ bool QQmlTypeData::loadImplicitImport()
void QQmlTypeData::dataReceived(const SourceCodeData &data)
{
m_backupSourceCode = data;
-
+#ifndef Q_OS_HTML5
if (tryLoadFromDiskCache())
return;
-
+#endif
if (isError())
return;
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp
index 038a75d50a..bdb066267a 100644
--- a/src/qml/qml/v8/qv8engine.cpp
+++ b/src/qml/qml/v8/qv8engine.cpp
@@ -129,11 +129,13 @@ QV8Engine::QV8Engine(QJSEngine *qq, QV4::ExecutionEngine *v4)
, m_v4Engine(v4)
, m_xmlHttpRequestData(nullptr)
{
+#ifndef Q_OS_HTML5
#ifdef Q_PROCESSOR_X86_32
if (!qCpuHasFeature(SSE2)) {
qFatal("This program requires an X86 processor that supports SSE2 extension, at least a Pentium 4 or newer");
}
#endif
+#endif
QML_MEMORY_SCOPE_STRING("QV8Engine::QV8Engine");
qMetaTypeId<QJSValue>();
diff --git a/src/qml/qtqmlglobal.h b/src/qml/qtqmlglobal.h
index 6e92867cf5..f22eb54c43 100644
--- a/src/qml/qtqmlglobal.h
+++ b/src/qml/qtqmlglobal.h
@@ -51,7 +51,9 @@
# include <QtNetwork/qtnetworkglobal.h>
# endif
#else
+//#ifndef QT_FEATURE_qml_debug
# define QT_FEATURE_qml_debug -1
+//#endif
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/qml/util/qqmlchangeset.cpp b/src/qml/util/qqmlchangeset.cpp
index ba876b42e2..561bde7d0c 100644
--- a/src/qml/util/qqmlchangeset.cpp
+++ b/src/qml/util/qqmlchangeset.cpp
@@ -68,6 +68,7 @@ QT_BEGIN_NAMESPACE
QQmlChangeSet::QQmlChangeSet()
: m_difference(0)
{
+ qRegisterMetaType<QQmlChangeSet >("QQmlChangeSet");
}
/*!
@@ -80,6 +81,7 @@ QQmlChangeSet::QQmlChangeSet(const QQmlChangeSet &changeSet)
, m_changes(changeSet.m_changes)
, m_difference(changeSet.m_difference)
{
+ qRegisterMetaType<QQmlChangeSet >("QQmlChangeSet");
}
/*!
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 9c775f7e93..cefe2de883 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -493,6 +493,9 @@ void QQuickFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal maxExt
data.inOvershoot = false;
fixupMode = Normal;
data.vTime = timeline.time();
+#ifdef Q_OS_HTML5
+ QCoreApplication::processEvents(QEventLoop::EventLoopExec);
+#endif
}
static bool fuzzyLessThanOrEqualTo(qreal a, qreal b)
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 48eba6a7a0..02fe4809ab 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -536,6 +536,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 481366222d..37f0a812e7 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/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 2eaed497ef..3cdf851a8f 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -201,10 +201,10 @@ QSGRenderLoop *QSGRenderLoop::instance()
loopType = ThreadedRenderLoop;
else
loopType = WindowsRenderLoop;
-#else
+#endif
if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL))
loopType = ThreadedRenderLoop;
-#endif
+
if (qmlNoThreadedRenderer())
loopType = BasicRenderLoop;
else if (qmlForceThreadedRenderer())
@@ -220,6 +220,11 @@ QSGRenderLoop *QSGRenderLoop::instance()
loopType = ThreadedRenderLoop;
}
+#ifdef QT_NO_THREAD
+ if (loopType == ThreadedRenderLoop)
+ loopType = BasicRenderLoop;
+#endif
+
switch (loopType) {
case ThreadedRenderLoop:
qCDebug(QSG_LOG_INFO, "threaded render loop");
@@ -408,7 +413,6 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
renderTimer.start();
Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphPolishFrame);
-
cd->polishItems();
if (profileFrames)
@@ -470,6 +474,9 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
// Might have been set during syncSceneGraph()
if (data.updatePending)
maybeUpdate(window);
+#ifdef Q_OS_HTML5
+ QCoreApplication::processEvents(QEventLoop::EventLoopExec);
+#endif
}
void QSGGuiThreadRenderLoop::exposureChanged(QQuickWindow *window)
diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri
index 4fa3e7b6bf..ac70c3153f 100644
--- a/src/quick/scenegraph/scenegraph.pri
+++ b/src/quick/scenegraph/scenegraph.pri
@@ -1,5 +1,6 @@
# DEFINES += QSG_SEPARATE_INDEX_BUFFER
# DEFINES += QSG_DISTANCEFIELD_CACHE_DEBUG
+emscripten: DEFINES += QSG_SEPARATE_INDEX_BUFFER
# Core API
HEADERS += \