summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2016-06-24 12:45:48 +0200
committerJohan Helsing <johan.helsing@qt.io>2016-07-20 08:24:21 +0000
commitb6dff11dc9781b677c02c8308a44e85f2d919fa0 (patch)
treec7e7c0f3d3a8eed8222ff763ae295c074acc5e53 /src/compositor/wayland_wrapper
parentef3e687fe6b983fb0a5bf648f2d66f2eadd85b58 (diff)
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/compositor/wayland_wrapper')
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp10
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
index 71ae6e212..df2dded2f 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 609581493..e0a7d021f 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: