From c48bc48dda852519e1951b03eb222a89a62efd29 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 16 Mar 2016 23:35:20 -0700 Subject: [PATCH] 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 file changed, 5 insertions(+) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 707b2dcb43..46255ef277 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; -- 2.30.2