summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/offscreen
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-05-06 14:02:16 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2021-05-06 21:09:45 +0200
commit11ae678b9d9b3ea60c3c210cdb129d7abe7d4471 (patch)
tree470cf135b30b140ee3825c8f28320cbe8624e507 /src/plugins/platforms/offscreen
parent175e3ac8fabc864ffcc23c7769eaf7f220bddf59 (diff)
Put the GLX related code under the xcb_glx_plugin condition
If the xcb-glx-plugin feature is not enabled we should not compile classes and methods that use the GLX related code of the QOffscreenIntegrationPlugin. Pick-to: 6.1 6.0 Change-Id: I63eff9d0a2afc1bc1fa21ee1b49f854f13b94c93 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/offscreen')
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp7
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration_x11.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp
index a11da2d543..1e533f87dc 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp
@@ -88,6 +88,7 @@ bool QOffscreenX11Integration::hasCapability(QPlatformIntegration::Capability ca
}
}
+#if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin)
QPlatformOpenGLContext *QOffscreenX11Integration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
auto &connection = nativeInterface()->m_connection;
@@ -100,6 +101,7 @@ QPlatformOpenGLContext *QOffscreenX11Integration::createPlatformOpenGLContext(QO
return new QOffscreenX11GLXContext(connection->x11Info(), context);
}
+#endif // !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin)
QOffscreenX11PlatformNativeInterface *QOffscreenX11Integration::nativeInterface() const
{
@@ -121,7 +123,7 @@ void *QOffscreenX11PlatformNativeInterface::nativeResourceForScreen(const QByteA
return nullptr;
}
-#ifndef QT_NO_OPENGL
+#if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin)
void *QOffscreenX11PlatformNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) {
if (resource.toLower() == QByteArrayLiteral("glxconfig") ) {
if (context) {
@@ -164,6 +166,7 @@ QOffscreenX11Info *QOffscreenX11Connection::x11Info()
return m_x11Info.data();
}
+#if QT_CONFIG(xcb_glx_plugin)
class QOffscreenX11GLXContextData
{
public:
@@ -311,5 +314,5 @@ void *QOffscreenX11GLXContext::glxConfig() const
{
return d->config;
}
-
+#endif // QT_CONFIG(xcb_glx_plugin)
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h
index ed4b83c0a4..7e26b76759 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h
@@ -59,7 +59,7 @@ public:
~QOffscreenX11PlatformNativeInterface();
void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override;
-#ifndef QT_NO_OPENGL
+#if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin)
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override;
#endif
@@ -72,7 +72,9 @@ public:
~QOffscreenX11Integration();
bool hasCapability(QPlatformIntegration::Capability cap) const override;
+#if !defined(QT_NO_OPENGL) && QT_CONFIG(xcb_glx_plugin)
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
+#endif
QOffscreenX11PlatformNativeInterface *nativeInterface() const override;
};
@@ -93,6 +95,7 @@ private:
QScopedPointer<QOffscreenX11Info> m_x11Info;
};
+#if QT_CONFIG(xcb_glx_plugin)
class QOffscreenX11GLXContextData;
class QOffscreenX11GLXContext : public QPlatformOpenGLContext
@@ -119,6 +122,7 @@ public:
private:
QScopedPointer<QOffscreenX11GLXContextData> d;
};
+#endif // QT_CONFIG(xcb_glx_plugin)
QT_END_NAMESPACE