summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2016-03-02 11:27:46 +0100
committerDominik Holland <dominik.holland@pelagicore.com>2016-05-18 15:08:53 +0000
commitc7832b0a1d4e5e095e56315c43145bb8964f7030 (patch)
tree30e63aa55221255e9d759be7cdaae924e6e0798e /src/compositor/wayland_wrapper
parent959d9d604da402e768ce329d43510d2b03756d89 (diff)
Fixed eglStream compositing
When creating the eglStream from the fd we also need to create the texture and call stream_consumer_gltexture. Otherwise the wayland client can't create the wayland client surface. Fixed the qwindow-compositor example to use the texture associated to the QWaylandBufferRef when compositing a EXTERNAL_OES target. QML compositing only works when QSG_RENDER_LOOP is set to basic as we need to generate a texture from the gui thread. As the texture is created by the bufferintegration it might end up in a different gl context than the quick item using it. The texture is also deleted together with the buffer, which prevents the use of the texture afterwards. Both problems need to be fixed in follow up commits. Task-number: QTBUG-50850 Change-Id: Ifec67bbe9e4b2a680c871dc4aced37b71b7b6f80 Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'src/compositor/wayland_wrapper')
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp8
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
index c7bdbcee5..14ccde13a 100644
--- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
+++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
@@ -232,6 +232,14 @@ void SurfaceBuffer::bindToTexture() const
}
}
+uint SurfaceBuffer::textureForPlane(int plane) const
+{
+ if (QtWayland::ClientBufferIntegration *clientInt = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration())
+ return clientInt->textureForBuffer(m_buffer, plane);
+
+ return 0;
+}
+
void SurfaceBuffer::updateTexture() const
{
if (QtWayland::ClientBufferIntegration *clientInt = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration())
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
index 85f78d41b..95e7e8158 100644
--- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
+++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
@@ -106,6 +106,7 @@ public:
QImage image() const;
QWaylandBufferRef::BufferFormatEgl bufferFormatEgl() const;
void bindToTexture() const;
+ uint textureForPlane(int plane) const;
void updateTexture() const;
static bool hasContent(SurfaceBuffer *buffer) { return buffer && buffer->waylandBufferHandle(); }