wayland: Add support for EGLStream client buffers

Desktop / GNOME / Mutter - Jonas Ådahl [gmail.com] - 17 November 2016 10:00 EST

This commit adds for a new type of buffer being attached to a Wayland surface: buffers from an EGLStream. These buffers behave very differently from regular Wayland buffers; instead of each buffer reperesenting an actual frame, the same buffer is attached over and over again, and EGL API is used to switch the content of the OpenGL texture associated with the buffer attached. It more or less side-tracks the Wayland buffer handling.

It is implemented by creating a MetaWaylandEglStream object, dealing with the EGLStream state. The lifetime of the MetaWaylandEglStream is tied to the texture object (CoglTexture), which is referenced-counted and owned by both the actors and the MetaWaylandBuffer.

When the buffer is reattached and committed, the EGLStream is triggered to switch the content of the associated texture to the new content. This means that one cannot keep old texture content around without copying, so any feature relying on that will effectively be broken.

https://bugzilla.gnome.org/show_bug.cgi?id=773629

eed4dab wayland: Add support for EGLStream client buffers
src/Makefile.am | 2 +
src/backends/native/meta-renderer-native.c | 12 ++
src/wayland/meta-wayland-buffer.c | 51 +++++
src/wayland/meta-wayland-buffer.h | 6 +
src/wayland/meta-wayland-egl-stream.c | 279 ++++++++++++++++++++++++++++
src/wayland/meta-wayland-egl-stream.h | 52 ++++++
src/wayland/meta-wayland-surface.c | 4 +
7 files changed, 406 insertions(+)

Upstream: git.gnome.org


  • Share