summaryrefslogtreecommitdiff
path: root/src/wayland/meta-wayland-surface.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2016-10-20 15:59:09 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-11-18 00:00:10 +0800
commiteed4dab0fc1d143e83f2d147d49c415bd4dbd6e3 (patch)
treee3f74cc21418a333a133ac5331772592e6a623ea /src/wayland/meta-wayland-surface.c
parentf5bdf75f70272bd1bce632ecf15c8f5157343bea (diff)
downloadmutter-eed4dab0fc1d143e83f2d147d49c415bd4dbd6e3.tar.gz
wayland: Add support for EGLStream client buffers
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
Diffstat (limited to 'src/wayland/meta-wayland-surface.c')
-rw-r--r--src/wayland/meta-wayland-surface.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 046806c36..b780c0fdc 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -755,14 +755,18 @@ apply_pending_state (MetaWaylandSurface *surface,
{
MetaShapedTexture *stex;
CoglTexture *texture;
+ CoglSnippet *snippet;
gboolean is_y_inverted;
stex = meta_surface_actor_get_texture (surface->surface_actor);
texture = meta_wayland_buffer_get_texture (pending->buffer);
+ snippet = meta_wayland_buffer_create_snippet (pending->buffer);
is_y_inverted = meta_wayland_buffer_is_y_inverted (pending->buffer);
meta_shaped_texture_set_texture (stex, texture);
+ meta_shaped_texture_set_snippet (stex, snippet);
meta_shaped_texture_set_is_y_inverted (stex, is_y_inverted);
+ g_clear_pointer (&snippet, cogl_object_unref);
}
}