egl/wayland/sw: fix no-op updating of current backbuffer

if the frontbuffer is the backbuffer then its contents are up-to-date

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
This commit is contained in:
Mike Blumenkrantz 2024-02-22 10:04:26 -05:00 committed by Marge Bot
parent 75cf82005d
commit d90b14c768

View file

@ -2432,12 +2432,14 @@ dri2_wl_swrast_get_image(__DRIdrawable *read, int x, int y, int w, int h,
char *src, *dst;
src = dri2_wl_swrast_get_frontbuffer_data(dri2_surf);
/* this is already the most up-to-date buffer */
if (src == data)
return;
if (!src) {
memset(data, 0, copy_width * h);
return;
}
assert(data != src);
assert(copy_width <= src_stride);
src += x_offset;