summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorChristian Hergert <christian@hergert.me>2016-03-16 23:35:20 -0700
committerMatthias Clasen <mclasen@redhat.com>2016-03-21 22:03:20 -0400
commitc48bc48dda852519e1951b03eb222a89a62efd29 (patch)
tree8cfe81e42c49d039ccd37b528f2d522dfb146580 /gdk
parent7c2f81bcd9b0d0c105351a5d7c643e0eaf430e7c (diff)
downloadgtk+-c48bc48dda852519e1951b03eb222a89a62efd29.tar.gz
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
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkwindow-wayland.c5
1 files changed, 5 insertions, 0 deletions
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;