summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-02-08 15:31:15 +0100
committerMichal Klocek <michal.klocek@qt.io>2019-02-18 15:37:43 +0000
commit94a4f06fb88ec6c7fa5e31dfd28af4e9b3cdbdd8 (patch)
tree5742bed0a8f84f56cdfb1946c08ced3c72421a75 /src/plugins/platforms/offscreen/qoffscreenintegration.cpp
parente57fe14a04fa077786bbde90c089b4c494150430 (diff)
Add run-time qpa offscreen glx support selection
Introduce QT_QPA_OFFSCREEN_NO_GLX to run offscreen qpa without glx even if compiled with x11 support. Task-number: QTBUG-63346 Change-Id: I647bf5df27f095c3dd27a90415cc9c445df93fd1 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/offscreen/qoffscreenintegration.cpp')
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
index 9815be16a3..efd8fdf3fa 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
@@ -66,6 +66,10 @@
#include <qpa/qplatformservices.h>
+#if QT_CONFIG(system_xcb) && QT_CONFIG(xlib) && QT_CONFIG(opengl) && !QT_CONFIG(opengles2)
+#include "qoffscreenintegration_x11.h"
+#endif
+
QT_BEGIN_NAMESPACE
class QCoreTextFontEngine;
@@ -219,4 +223,14 @@ QPlatformServices *QOffscreenIntegration::services() const
return m_services.data();
}
+QOffscreenIntegration *QOffscreenIntegration::createOffscreenIntegration()
+{
+#if QT_CONFIG(system_xcb) && QT_CONFIG(xlib) && QT_CONFIG(opengl) && !QT_CONFIG(opengles2)
+ QByteArray glx = qgetenv("QT_QPA_OFFSCREEN_NO_GLX");
+ if (glx.isEmpty())
+ return new QOffscreenX11Integration;
+#endif
+ return new QOffscreenIntegration;
+}
+
QT_END_NAMESPACE