From 8e0e75999ed8a264d71a73a3e43bbab476a412fa Mon Sep 17 00:00:00 2001 From: Chao Guo Date: Mon, 18 Dec 2023 11:23:28 +0900 Subject: [PATCH] compositor: improve viewport source validity check If client changes the buffer transform or size and re-commit the surface before surface dirtys buffer (weston_surface_attach), the viewport source validity check may fail. Because the width_from_buffer and height_from_buffer cannot be updated based on new buffer transform. Therefore, add the situation of size dirty (WESTON_SURFACE_DIRTY_SIZE) to source validity check, width_from_buffer and height_from_buffer can be updated in time when the buffer transform and scale change. Signed-off-by: Chao Guo --- libweston/compositor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 2d3b0aa3..db8b14a5 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -4305,7 +4305,8 @@ weston_surface_is_pending_viewport_source_valid( if (vp->buffer.src_width == wl_fixed_from_int(-1)) return true; - if (pend->status & WESTON_SURFACE_DIRTY_BUFFER) { + if ((pend->status & WESTON_SURFACE_DIRTY_BUFFER) || + (pend->status & WESTON_SURFACE_DIRTY_SIZE)) { if (pend->buffer) { convert_size_by_transform_scale(&width_from_buffer, &height_from_buffer,