From: Christian Hergert Date: Thu, 17 Mar 2016 06:35:20 +0000 (-0700) Subject: wayland: avoid dropping surfaces when possible X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~24^2~5152 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c48bc48dda852519e1951b03eb222a89a62efd29;p=gtk4.git 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 --- 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;