Add output damage test to the test suite
Depends on: !520 (merged)
This adds a test, which iterates over renderers, output scales, and output transforms; for each case, it:
- paints a gray surface with full damage
- swaps the buffer to a completely cyan one, but damages only a small portion of the surface
- checks a screenshot that the surface is gray except the small part is cyan
- swaps the buffer to a completely green one, but damages only a different small portion of the surface
- checks a screenshot that the surface is gray except for the two small parts in cyan and green
The purpose of the test is to ensure that the client submitted damage in surface coordinates is correctly transformed to the output. This obviously depends on Weston repainting exactly that region and nothing more, which required a little bit of preparation to achieve.
The screenshooting function used to inflict damage, which obliterates the damage I wanted to test for. Before removing that damage, I needed to make sure that screenshooting still works without it, and noticed that it might get stuck on DRM-backend sometimes. So I wrote a test for DRM-backend screenshots not getting stuck, fixed the need for damage, and removed the unwanted damage. The final hurdle was to make GL-renderer not imply full damage on pbuffer EGL surfaces when buffer age is not available.
This is the first piece in ensuring that Weston's damage tracking works correctly. This is only the simplest case, but it should already be fairly powerful in ensuring that a good part of the complicated code to handle damage regions is correct. More tests would be necessary to cover for more aspects of damage: client damage in buffer coordinates, combined with buffer scale/transform and
wp_viewport; complex damage regions; occluded damage; damage below transparent areas.