[gtk+] wayland: avoid dropping surfaces when possible



commit c48bc48dda852519e1951b03eb222a89a62efd29
Author: Christian Hergert <christian hergert me>
Date:   Wed Mar 16 23:35:20 2016 -0700

    wayland: avoid dropping surfaces when possible
    
    If the configure-event gives us the same size as we had before,
    which is common for animation resizes, then try to keep the
    existing buffer around. This saves us a memfd_create() syscall
    on every frame.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763350

 gdk/wayland/gdkwindow-wayland.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 707b2dc..46255ef 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -256,6 +256,11 @@ gdk_wayland_window_update_size (GdkWindow *window,
   GdkRectangle area;
   cairo_region_t *region;
 
+  if ((window->width == width) &&
+      (window->height == height) &&
+      (impl->scale == scale))
+    return;
+
   drop_cairo_surfaces (window);
 
   window->width = width;


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