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
This commit is contained in:
Christian Hergert 2016-03-16 23:35:20 -07:00 committed by Matthias Clasen
parent 7c2f81bcd9
commit c48bc48dda

View File

@ -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;