aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-09-08 17:22:47 +0200
committerAndy Nichols <andy.nichols@digia.com>2014-09-09 13:27:08 +0300
commit363830db7b14e53ce3c976c142da8edf1b648c69 (patch)
treebc10a6e274374b25a15e32b7dd8a90a4ea0bc9af
parent7cfec8b936a10b579d0f97acc0cb681f82f6fa85 (diff)
Check for Threaded Pixmaps capability for threaded renderer
By default we used the threaded renderer, but this will only work if the platform has the capability to render to QPixmaps from multiple threads. Now if we don't have the Threaded Pixmaps capability we use the non-threaded render loop. Change-Id: I5090e874d0bbdd1e54561ea3583a5a17bbf50061 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--src/plugins/scenegraph/softwarecontext/pluginmain.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/pluginmain.cpp b/src/plugins/scenegraph/softwarecontext/pluginmain.cpp
index afb91a8ea2..a928cb6e5e 100644
--- a/src/plugins/scenegraph/softwarecontext/pluginmain.cpp
+++ b/src/plugins/scenegraph/softwarecontext/pluginmain.cpp
@@ -24,6 +24,9 @@
#include "renderloop.h"
#include "threadedrenderloop.h"
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
+
ContextPlugin::ContextPlugin(QObject *parent)
: QSGContextPlugin(parent)
{
@@ -43,8 +46,10 @@ QSGContext *ContextPlugin::create(const QString &) const
QSGRenderLoop *ContextPlugin::createWindowManager()
{
- if (qgetenv("QSG_RENDER_LOOP") == QByteArrayLiteral("basic"))
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedPixmaps) ||
+ qgetenv("QSG_RENDER_LOOP") == QByteArrayLiteral("basic"))
return new RenderLoop();
+
return new ThreadedRenderLoop();
}