diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-11-15 15:59:13 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-11-23 08:42:05 +0000 |
commit | 2333c58fff009435503c3b7ef3d86569227056eb (patch) | |
tree | c98fd555af28f6324b24a3884bc8f40fa18bde24 /src/compositor/compositor_api/qwaylandcompositor.cpp | |
parent | 1d5b44cbb1e834bc8db94d8ec1ac140b8ca9ed37 (diff) |
Use the feature system internally
Get rid of almost all DEFINES += ... in the pro files,
instead use the proper QT_CONFIG() macro to determine
whether a feature is available.
Change-Id: I867769be2085c6ba93b6815e223e2b89edcb245d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandcompositor.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandcompositor.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index bcee61d8b..29397f64f 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -35,6 +35,7 @@ ** ****************************************************************************/ +#include "qtwaylandcompositorglobal_p.h" #include "qwaylandcompositor.h" #include "qwaylandcompositor_p.h" @@ -60,7 +61,7 @@ #include "hardware_integration/qwlserverbufferintegration_p.h" #include "hardware_integration/qwlserverbufferintegrationfactory_p.h" -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) #include "hardware_integration/qwlhwintegration_p.h" #endif @@ -80,7 +81,7 @@ #include <QtGui/qpa/qplatformnativeinterface.h> #include <QtGui/private/qguiapplication_p.h> -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) # include <QOpenGLTextureBlitter> # include <QOpenGLTexture> # include <QOpenGLContext> @@ -107,7 +108,7 @@ public: uint32_t code = ke->nativeScanCode; bool isDown = ke->keyType == QEvent::KeyPress; -#ifndef QT_NO_WAYLAND_XKB +#if QT_CONFIG(xkbcommon_evdev) QString text; Qt::KeyboardModifiers modifiers = QWaylandXkb::modifiers(keyb->xkbState()); @@ -143,7 +144,7 @@ public: QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) : display(0) -#if defined (QT_WAYLAND_COMPOSITOR_GL) +#if QT_CONFIG(opengl) , use_hw_integration_extension(true) , client_buffer_integration(0) , server_buffer_integration(0) @@ -354,7 +355,7 @@ QWaylandSurface *QWaylandCompositorPrivate::createDefaultSurface() void QWaylandCompositorPrivate::initializeHardwareIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_Q(QWaylandCompositor); if (use_hw_integration_extension) hw_integration.reset(new QtWayland::HardwareIntegration(q)); @@ -377,7 +378,7 @@ void QWaylandCompositorPrivate::initializeSeats() void QWaylandCompositorPrivate::loadClientBufferIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_Q(QWaylandCompositor); QStringList keys = QtWayland::ClientBufferIntegrationFactory::keys(); QString targetKey; @@ -406,7 +407,7 @@ void QWaylandCompositorPrivate::loadClientBufferIntegration() void QWaylandCompositorPrivate::loadServerBufferIntegration() { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) QStringList keys = QtWayland::ServerBufferIntegrationFactory::keys(); QString targetKey; QByteArray serverBufferIntegration = qgetenv("QT_WAYLAND_SERVER_BUFFER_INTEGRATION"); @@ -852,7 +853,7 @@ QWaylandSeat *QWaylandCompositor::seatFor(QInputEvent *inputEvent) */ bool QWaylandCompositor::useHardwareIntegrationExtension() const { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_D(const QWaylandCompositor); return d->use_hw_integration_extension; #else @@ -862,7 +863,7 @@ bool QWaylandCompositor::useHardwareIntegrationExtension() const void QWaylandCompositor::setUseHardwareIntegrationExtension(bool use) { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) Q_D(QWaylandCompositor); if (use == d->use_hw_integration_extension) return; @@ -892,7 +893,7 @@ void QWaylandCompositor::grabSurface(QWaylandSurfaceGrabber *grabber, const QWay if (buffer.isSharedMemory()) { emit grabber->success(buffer.image()); } else { -#ifdef QT_WAYLAND_COMPOSITOR_GL +#if QT_CONFIG(opengl) if (QOpenGLContext::currentContext()) { QOpenGLFramebufferObject fbo(buffer.size()); fbo.bind(); |