Skip to content

Add Missing check for buffer size divisible by scale

Veeresh Kadasani requested to merge VKadasani/weston:invalid_buffer_size into main

Fixes: #367

wl_surface.attach specification says:

"The new size of the surface is calculated based on the buffer size transformed by the inverse buffer_transform and the inverse buffer_scale. This means that the supplied buffer must be an integer multiple of the buffer_scale."

Since the specification is worded "must", this implements the check in weston and raise a protocol error if the requirement is violated. Note, that if wp_viewport is used to explicitly set the destination size, then the buffer size requirement is lifted.

Also adds test to check this error is raised. when specification is violated.

Edited by Veeresh Kadasani

Merge request reports