Module: Mesa Branch: master Commit: e5b01183a69d8492a66d0c172ac44b9d9ba5fd59 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5b01183a69d8492a66d0c172ac44b9d9ba5fd59
Author: Daniel Stone <[email protected]> Date: Tue Mar 3 10:52:32 2020 +0000 egl/wayland: Don't invalidate buffers on no-op resize The Wayland platform's resize_callback is invoked from libwayland-egl when wl_egl_window_resize() is called. The resize call is the only place for the application to insert dx/dy arguments to wl_surface_attach(). When modifying the cursor hotspot (as in wayland/wayland#148), we want to set dx/dy, but leave the surface size the same. If we get wl_egl_window_resize() with the same width and height argument as we already have, we do not need to invalidate our existing drawable. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4030> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4030> --- src/egl/drivers/dri2/platform_wayland.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 324ac2357da..3a54badabfa 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -266,6 +266,10 @@ resize_callback(struct wl_egl_window *wl_win, void *data) struct dri2_egl_display *dri2_dpy = dri2_egl_display(dri2_surf->base.Resource.Display); + if (dri2_surf->base.Width == wl_win->width && + dri2_surf->base.Height == wl_win->height) + return; + /* Update the surface size as soon as native window is resized; from user * pov, this makes the effect that resize is done immediately after native * window resize, without requiring to wait until the first draw. _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
