summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandbufferref.cpp
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/compositor_api/qwaylandbufferref.cpp
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/compositor_api/qwaylandbufferref.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandbufferref.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp
index 929503b4f..e9fbcfbdb 100644
--- a/src/compositor/compositor_api/qwaylandbufferref.cpp
+++ b/src/compositor/compositor_api/qwaylandbufferref.cpp
@@ -241,6 +241,16 @@ QImage QWaylandBufferRef::image() const
return d->buffer->image();
}
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+GLuint QWaylandBufferRef::textureForPlane(int plane) const
+{
+ if (d->nullOrDestroyed())
+ return 0;
+
+ return d->buffer->textureForPlane(plane);
+}
+#endif
+
/*!
* Binds the buffer to the current OpenGL texture. This may
* perform a copy of the buffer data, depending on the platform