Blame SOURCES/0001-wayland-buffer-Create-EGLStream-texture-at-buffer_re.patch

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