[mutter/gnome-3-28] wayland-buffer: Create EGLStream texture at buffer_realize time
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-28] wayland-buffer: Create EGLStream texture at buffer_realize time
- Date: Fri, 31 Aug 2018 15:19:35 +0000 (UTC)
commit 53b040be5c55bf4b283599d2a912cb072937afd4
Author: Miguel A. Vico <mvicomoya nvidia com>
Date: Sat May 6 01:23:57 2017 +0000
wayland-buffer: Create EGLStream texture at buffer_realize time
When dealing with synchronized subsurfaces, we defer buffer attachments
until the parent surface state is applied.
That causes interaction issues with EGLStream backed buffers, as the
client expects the compositor-side stream to be functional after it
requests a wl_surface::attach.
By allowing the compositor to realize buffers without attaching them, we
could resolve the issue above if we define a realized EGLStream buffer
as a functional EGLStream (EGLStream + attached consumer).
This change moves the texture consumer creation part from the attach
function to the realize one.
https://bugzilla.gnome.org/show_bug.cgi?id=782575
(cherry picked from commit edd3634bb52a8efc687c612152fda5c996e94d26)
src/wayland/meta-wayland-buffer.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/wayland/meta-wayland-buffer.c b/src/wayland/meta-wayland-buffer.c
index 55564492a..6f4fd24bf 100644
--- a/src/wayland/meta-wayland-buffer.c
+++ b/src/wayland/meta-wayland-buffer.c
@@ -123,8 +123,18 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
stream = meta_wayland_egl_stream_new (buffer, NULL);
if (stream)
{
+ CoglTexture2D *texture;
+
buffer->egl_stream.stream = stream;
buffer->type = META_WAYLAND_BUFFER_TYPE_EGL_STREAM;
+
+ texture = meta_wayland_egl_stream_create_texture (stream, NULL);
+ if (!texture)
+ return FALSE;
+
+ buffer->texture = COGL_TEXTURE (texture);
+ buffer->is_y_inverted = meta_wayland_egl_stream_is_y_inverted (stream);
+
return TRUE;
}
@@ -314,18 +324,6 @@ egl_stream_buffer_attach (MetaWaylandBuffer *buffer,
g_assert (stream);
- if (!buffer->texture)
- {
- CoglTexture2D *texture;
-
- texture = meta_wayland_egl_stream_create_texture (stream, error);
- if (!texture)
- return FALSE;
-
- buffer->texture = COGL_TEXTURE (texture);
- buffer->is_y_inverted = meta_wayland_egl_stream_is_y_inverted (stream);
- }
-
if (!meta_wayland_egl_stream_attach (stream, error))
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]