diff options
-rw-r--r-- | src/quick/configure.json | 2 | ||||
-rw-r--r-- | src/quickshapes/qquickshapegenericrenderer.cpp | 18 | ||||
-rw-r--r-- | src/src.pro | 4 |
3 files changed, 19 insertions, 5 deletions
diff --git a/src/quick/configure.json b/src/quick/configure.json index 9d7bafcb3b..9ec3531ef4 100644 --- a/src/quick/configure.json +++ b/src/quick/configure.json @@ -129,7 +129,7 @@ "label": "Path support", "purpose": "Provides Path elements.", "section": "Qt Quick", - "condition": "features.thread && features.quick-shadereffect", + "condition": "features.quick-shadereffect", "output": [ "privateFeature" ] diff --git a/src/quickshapes/qquickshapegenericrenderer.cpp b/src/quickshapes/qquickshapegenericrenderer.cpp index 8a4785a83a..604da2a889 100644 --- a/src/quickshapes/qquickshapegenericrenderer.cpp +++ b/src/quickshapes/qquickshapegenericrenderer.cpp @@ -40,7 +40,10 @@ #include "qquickshapegenericrenderer_p.h" #include <QtGui/private/qtriangulator_p.h> #include <QtGui/private/qtriangulatingstroker_p.h> + +#if QT_CONFIG(thread) #include <QThreadPool> +#endif #if QT_CONFIG(opengl) #include <QSGVertexColorMaterial> @@ -278,6 +281,7 @@ void QQuickShapeGenericRenderer::setAsyncCallback(void (*callback)(void *), void m_asyncCallbackData = data; } +#if QT_CONFIG(thread) static QThreadPool *pathWorkThreadPool = nullptr; static void deletePathWorkThreadPool() @@ -285,9 +289,16 @@ static void deletePathWorkThreadPool() delete pathWorkThreadPool; pathWorkThreadPool = nullptr; } +#endif void QQuickShapeGenericRenderer::endSync(bool async) { +#if !QT_CONFIG(thread) + // Force synchronous mode for the no-thread configuration due + // to lack of QThreadPool. + async = false; +#endif + bool didKickOffAsync = false; for (int i = 0; i < m_sp.count(); ++i) { @@ -311,13 +322,14 @@ void QQuickShapeGenericRenderer::endSync(bool async) continue; } +#if QT_CONFIG(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 +360,9 @@ void QQuickShapeGenericRenderer::endSync(bool async) r->deleteLater(); }); didKickOffAsync = true; +#if QT_CONFIG(thread) pathWorkThreadPool->start(r); +#endif } else { triangulateFill(d.path, d.fillColor, &d.fillVertices, &d.fillIndices, &d.indexType, q_supportsElementIndexUint(m_api)); } @@ -376,7 +390,9 @@ void QQuickShapeGenericRenderer::endSync(bool async) r->deleteLater(); }); didKickOffAsync = true; +#if QT_CONFIG(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/src.pro b/src/src.pro index ba96bd09a1..2dc6fc2758 100644 --- a/src/src.pro +++ b/src/src.pro @@ -9,9 +9,7 @@ SUBDIRS += \ qtHaveModule(gui):qtConfig(qml-animation) { SUBDIRS += \ quick \ - - qtConfig(thread): \ - SUBDIRS += quickshapes + quickshapes qtConfig(testlib): \ SUBDIRS += qmltest |