[gtk+] wayland: Move the buffer creation to the cairo surface creation



commit 6977ea0bd1aa91e757a08d2d6a8fcc2adb08588c
Author: Rob Bradford <rob linux intel com>
Date:   Wed Apr 4 14:05:57 2012 +0100

    wayland: Move the buffer creation to the cairo surface creation

 gdk/wayland/gdkwindow-wayland.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index c2a4e4c..80ed791 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -351,9 +351,6 @@ gdk_wayland_window_attach_image (GdkWindow *window)
   /* Get a Wayland buffer from this new surface */
   data = cairo_surface_get_user_data (impl->cairo_surface,
 				      &gdk_wayland_cairo_key);
-  if (!data->buffer)
-    data->buffer =
-      wl_egl_pixmap_create_buffer(data->pixmap);
 
   if (impl->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT)
     dx = server_width - data->width;
@@ -416,6 +413,10 @@ gdk_wayland_create_cairo_surface (GdkDisplayWayland *display,
   if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
     fprintf (stderr, "create gl surface failed\n");
 
+  if (!data->buffer)
+    data->buffer =
+      wl_egl_pixmap_create_buffer(data->pixmap);
+
   return surface;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]