diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-06-24 12:45:48 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-07-20 08:24:21 +0000 |
commit | b6dff11dc9781b677c02c8308a44e85f2d919fa0 (patch) | |
tree | c7e7c0f3d3a8eed8222ff763ae295c074acc5e53 /src | |
parent | ef3e687fe6b983fb0a5bf648f2d66f2eadd85b58 (diff) | |
download | qtwayland-b6dff11dc9781b677c02c8308a44e85f2d919fa0.tar.gz |
Compile with -no-opengl
QtWayland has not compiled without OpenGL for a while.
This patch fixes the compilation issues and removes the old config variable,
"QT_WAYLAND_GL_CONFIG" and instead checks for the presence of "opengl" in
"QT_CONFIG". A new define is also introduced, QT_WAYLAND_COMPOSITOR_QUICK,
because it may eventually be possible to use create a QtQuick compositor
without OpenGL.
Task-number: QTBUG-54322
Change-Id: Ica7b3b320212d4ae1f8b1053725b73c83739c73c
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/client/client.pro | 2 | ||||
-rw-r--r-- | src/client/qwaylandnativeinterface.cpp | 2 | ||||
-rw-r--r-- | src/compositor/compositor_api/compositor_api.pri | 4 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandbufferref.cpp | 2 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandbufferref.h | 4 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandcompositor.cpp | 12 | ||||
-rw-r--r-- | src/compositor/extensions/extensions.pri | 2 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandshellsurface.h | 2 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandwlshell.cpp | 4 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandwlshell.h | 2 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandxdgshell.cpp | 7 | ||||
-rw-r--r-- | src/compositor/extensions/qwaylandxdgshell.h | 4 | ||||
-rw-r--r-- | src/compositor/hardware_integration/hardware_integration.pri | 4 | ||||
-rw-r--r-- | src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp | 10 | ||||
-rw-r--r-- | src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h | 2 |
15 files changed, 54 insertions, 9 deletions
diff --git a/src/client/client.pro b/src/client/client.pro index c8a8471b..63012c12 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -10,7 +10,7 @@ QMAKE_CXXFLAGS_WARN_ON -= -Wcast-qual CONFIG -= precompile_header CONFIG += link_pkgconfig qpa/genericunixfontdatabase wayland-scanner -!equals(QT_WAYLAND_GL_CONFIG, nogl) { +contains(QT_CONFIG, opengl) { DEFINES += QT_WAYLAND_GL_SUPPORT } diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index bad64204..be639ce1 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -117,6 +117,7 @@ void *QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) { +#ifdef QT_WAYLAND_GL_SUPPORT QByteArray lowerCaseResource = resource.toLower(); if (lowerCaseResource == "eglconfig" && m_integration->clientBufferIntegration()) @@ -127,6 +128,7 @@ void *QWaylandNativeInterface::nativeResourceForContext(const QByteArray &resour if (lowerCaseResource == "egldisplay" && m_integration->clientBufferIntegration()) return m_integration->clientBufferIntegration()->nativeResourceForContext(QWaylandClientBufferIntegration::EglDisplay, context->handle()); +#endif return 0; } diff --git a/src/compositor/compositor_api/compositor_api.pri b/src/compositor/compositor_api/compositor_api.pri index 1724ec96..5a2b77f6 100644 --- a/src/compositor/compositor_api/compositor_api.pri +++ b/src/compositor/compositor_api/compositor_api.pri @@ -45,7 +45,9 @@ SOURCES += \ QT += core-private -qtHaveModule(quick) { +qtHaveModule(quick):contains(QT_CONFIG, opengl) { + DEFINES += QT_WAYLAND_COMPOSITOR_QUICK + SOURCES += \ compositor_api/qwaylandquickcompositor.cpp \ compositor_api/qwaylandquicksurface.cpp \ diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp index 9bdac5db..a00bbcdd 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.cpp +++ b/src/compositor/compositor_api/qwaylandbufferref.cpp @@ -249,7 +249,6 @@ GLuint QWaylandBufferRef::textureForPlane(int plane) const return d->buffer->textureForPlane(plane); } -#endif /*! * Binds the buffer to the current OpenGL texture. This may @@ -272,5 +271,6 @@ void QWaylandBufferRef::updateTexture() const d->buffer->updateTexture(); } +#endif QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandbufferref.h b/src/compositor/compositor_api/qwaylandbufferref.h index bca42df9..77f817ab 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.h +++ b/src/compositor/compositor_api/qwaylandbufferref.h @@ -96,12 +96,12 @@ public: bool isSharedMemory() const; QImage image() const; + #ifdef QT_WAYLAND_COMPOSITOR_GL GLuint textureForPlane(int plane) const; -#endif - void bindToTexture() const; void updateTexture() const; +#endif private: class QWaylandBufferRefPrivate *const d; diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index c2693a2d..f5f809e9 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -58,7 +58,10 @@ #include "hardware_integration/qwlclientbufferintegrationfactory_p.h" #include "hardware_integration/qwlserverbufferintegration_p.h" #include "hardware_integration/qwlserverbufferintegrationfactory_p.h" + +#ifdef QT_WAYLAND_COMPOSITOR_GL #include "hardware_integration/qwlhwintegration_p.h" +#endif #include "extensions/qwaylandqtwindowmanager.h" @@ -814,12 +817,17 @@ QWaylandInputDevice *QWaylandCompositor::inputDeviceFor(QInputEvent *inputEvent) */ bool QWaylandCompositor::useHardwareIntegrationExtension() const { +#ifdef QT_WAYLAND_COMPOSITOR_GL Q_D(const QWaylandCompositor); return d->use_hw_integration_extension; +#else + return false; +#endif } void QWaylandCompositor::setUseHardwareIntegrationExtension(bool use) { +#ifdef QT_WAYLAND_COMPOSITOR_GL Q_D(QWaylandCompositor); if (use == d->use_hw_integration_extension) return; @@ -829,6 +837,10 @@ void QWaylandCompositor::setUseHardwareIntegrationExtension(bool use) d->use_hw_integration_extension = use; useHardwareIntegrationExtensionChanged(); +#else + if (use) + qWarning() << "Hardware integration not supported without OpenGL support"; +#endif } /*! diff --git a/src/compositor/extensions/extensions.pri b/src/compositor/extensions/extensions.pri index 7aa4a370..bb0abe88 100644 --- a/src/compositor/extensions/extensions.pri +++ b/src/compositor/extensions/extensions.pri @@ -35,7 +35,7 @@ SOURCES += \ extensions/qwaylandqtwindowmanager.cpp \ extensions/qwaylandxdgshell.cpp \ -qtHaveModule(quick) { +qtHaveModule(quick):contains(QT_CONFIG, opengl) { HEADERS += \ extensions/qwaylandquickshellsurfaceitem.h \ extensions/qwaylandquickshellsurfaceitem_p.h \ diff --git a/src/compositor/extensions/qwaylandshellsurface.h b/src/compositor/extensions/qwaylandshellsurface.h index 1e9fcb5a..88c736d2 100644 --- a/src/compositor/extensions/qwaylandshellsurface.h +++ b/src/compositor/extensions/qwaylandshellsurface.h @@ -50,7 +50,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShellSurface : public QWaylandComposit { Q_OBJECT public: +#ifdef QT_WAYLAND_COMPOSITOR_QUICK virtual QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) = 0; +#endif QWaylandShellSurface(QWaylandObject *waylandObject) : QWaylandCompositorExtension(waylandObject) {} protected: diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index d39876cb..3e53af62 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -38,7 +38,9 @@ #include "qwaylandwlshell.h" #include "qwaylandwlshell_p.h" +#ifdef QT_WAYLAND_COMPOSITOR_QUICK #include "qwaylandwlshellintegration_p.h" +#endif #include <QtWaylandCompositor/QWaylandCompositor> #include <QtWaylandCompositor/QWaylandView> @@ -527,10 +529,12 @@ void QWaylandWlShellSurface::sendPopupDone() d->send_popup_done(); } +#ifdef QT_WAYLAND_COMPOSITOR_QUICK QWaylandQuickShellIntegration *QWaylandWlShellSurface::createIntegration(QWaylandQuickShellSurfaceItem *item) { return new QtWayland::WlShellIntegration(item); } +#endif /*! * \qmlproperty object QtWaylandCompositor::WlShellSurface::surface diff --git a/src/compositor/extensions/qwaylandwlshell.h b/src/compositor/extensions/qwaylandwlshell.h index 13dae2e3..38d87a8c 100644 --- a/src/compositor/extensions/qwaylandwlshell.h +++ b/src/compositor/extensions/qwaylandwlshell.h @@ -136,7 +136,9 @@ public: Q_INVOKABLE void sendConfigure(const QSize &size, ResizeEdge edges); Q_INVOKABLE void sendPopupDone(); +#ifdef QT_WAYLAND_COMPOSITOR_QUICK QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) Q_DECL_OVERRIDE; +#endif public Q_SLOTS: void ping(); diff --git a/src/compositor/extensions/qwaylandxdgshell.cpp b/src/compositor/extensions/qwaylandxdgshell.cpp index 92676e0e..8299bd4c 100644 --- a/src/compositor/extensions/qwaylandxdgshell.cpp +++ b/src/compositor/extensions/qwaylandxdgshell.cpp @@ -36,7 +36,10 @@ #include "qwaylandxdgshell.h" #include "qwaylandxdgshell_p.h" + +#ifdef QT_WAYLAND_COMPOSITOR_QUICK #include "qwaylandxdgshellintegration_p.h" +#endif #include <QtWaylandCompositor/QWaylandCompositor> #include <QtWaylandCompositor/QWaylandSurface> @@ -976,10 +979,12 @@ uint QWaylandXdgSurface::sendResizing(const QSize &maxSize) return sendConfigure(maxSize, conf.states); } +#ifdef QT_WAYLAND_COMPOSITOR_QUICK QWaylandQuickShellIntegration *QWaylandXdgSurface::createIntegration(QWaylandQuickShellSurfaceItem *item) { return new QtWayland::XdgShellIntegration(item); } +#endif /*! * \class QWaylandXdgPopup @@ -1139,9 +1144,11 @@ void QWaylandXdgPopup::sendPopupDone() d->send_popup_done(); } +#ifdef QT_WAYLAND_COMPOSITOR_QUICK QWaylandQuickShellIntegration *QWaylandXdgPopup::createIntegration(QWaylandQuickShellSurfaceItem *item) { return new QtWayland::XdgPopupIntegration(item); } +#endif QT_END_NAMESPACE diff --git a/src/compositor/extensions/qwaylandxdgshell.h b/src/compositor/extensions/qwaylandxdgshell.h index 35b55fa2..263633dc 100644 --- a/src/compositor/extensions/qwaylandxdgshell.h +++ b/src/compositor/extensions/qwaylandxdgshell.h @@ -159,7 +159,9 @@ public: Q_INVOKABLE uint sendFullscreen(const QSize &size); Q_INVOKABLE uint sendResizing(const QSize &maxSize); +#ifdef QT_WAYLAND_COMPOSITOR_QUICK QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) Q_DECL_OVERRIDE; +#endif Q_SIGNALS: void surfaceChanged(); @@ -222,7 +224,9 @@ public: Q_INVOKABLE void sendPopupDone(); +#ifdef QT_WAYLAND_COMPOSITOR_QUICK QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) Q_DECL_OVERRIDE; +#endif Q_SIGNALS: void surfaceChanged(); diff --git a/src/compositor/hardware_integration/hardware_integration.pri b/src/compositor/hardware_integration/hardware_integration.pri index 8b450e5d..624190a6 100644 --- a/src/compositor/hardware_integration/hardware_integration.pri +++ b/src/compositor/hardware_integration/hardware_integration.pri @@ -1,6 +1,4 @@ -isEmpty(QT_WAYLAND_GL_CONFIG):QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG) - -!isEqual(QT_WAYLAND_GL_CONFIG,nogl) { +contains(QT_CONFIG, opengl) { CONFIG += wayland-scanner WAYLANDSERVERSOURCES += \ ../extensions/server-buffer-extension.xml \ diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index 71ae6e21..df2dded2 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -83,8 +83,10 @@ void SurfaceBuffer::initialize(struct ::wl_resource *buffer) m_destroy_listener.surfaceBuffer = this; m_destroy_listener.listener.notify = destroy_listener_callback; if (buffer) { +#ifdef QT_WAYLAND_COMPOSITOR_GL if (ClientBufferIntegration *integration = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) integration->initializeBuffer(buffer); +#endif wl_signal_add(&buffer->destroy_signal, &m_destroy_listener.listener); } } @@ -167,9 +169,11 @@ QSize SurfaceBuffer::size() const int height = wl_shm_buffer_get_height(shmBuffer); return QSize(width, height); } +#ifdef QT_WAYLAND_COMPOSITOR_GL if (ClientBufferIntegration *integration = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) { return integration->bufferSize(m_buffer); } +#endif return QSize(); } @@ -180,9 +184,11 @@ QWaylandSurface::Origin SurfaceBuffer::origin() const return QWaylandSurface::OriginTopLeft; } +#ifdef QT_WAYLAND_COMPOSITOR_GL if (ClientBufferIntegration *integration = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) { return integration->origin(m_buffer); } +#endif return QWaylandSurface::OriginTopLeft; } @@ -203,12 +209,15 @@ QWaylandBufferRef::BufferFormatEgl SurfaceBuffer::bufferFormatEgl() const { Q_ASSERT(isSharedMemory() == false); +#ifdef QT_WAYLAND_COMPOSITOR_GL if (QtWayland::ClientBufferIntegration *clientInt = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) return clientInt->bufferFormat(m_buffer); +#endif return QWaylandBufferRef::BufferFormatEgl_Null; } +#ifdef QT_WAYLAND_COMPOSITOR_GL void SurfaceBuffer::bindToTexture() const { Q_ASSERT(m_compositor); @@ -245,6 +254,7 @@ void SurfaceBuffer::updateTexture() const if (QtWayland::ClientBufferIntegration *clientInt = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) clientInt->updateTextureForBuffer(m_buffer); } +#endif } diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index 60958149..e0a7d021 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -105,9 +105,11 @@ public: QImage image() const; QWaylandBufferRef::BufferFormatEgl bufferFormatEgl() const; +#ifdef QT_WAYLAND_COMPOSITOR_GL void bindToTexture() const; uint textureForPlane(int plane) const; void updateTexture() const; +#endif static bool hasContent(SurfaceBuffer *buffer) { return buffer && buffer->waylandBufferHandle(); } private: |