compositor: improve viewport source validity check
- Problem Description:
If the client sets the
src_width
andsrc_height
of the viewport buffer, the viewport source valid check may
report error when client changes the buffer rotation transform during video playback.
- Root Cause:
If client changes the buffer transform or size and re-commit the surface during video playback, Weston will start viewport source valid
check (weston_surface_is_pending_viewport_source_valid()
). At this time, the status of the surface has not been marked as
WESTON_SURFACE_DIRTY_BUFFER
since the surface attach has not yet been performed.
Therefore, Weston will not calculatewidth_from_buffer
andheight_from_buffer
based on the new buffer transform, which will
cause the oldwidth_from_buffer
andheight_from_buffer
be used to checksrc_width
andsrc_height
and lead to error.
- Solution:
Add the situation of
WESTON_SURFACE_DIRTY_SIZE
to source validity check,width_from_buffer
andheight_from_buffer
can be updated in time when the buffer transform and scale are changed.