headless: add GL-renderer support
The GL-renderer is still not tested under the headless-backend at all, which makes our CI miss a big chunk of code. The first step to fix that is to add optional GL-renderer support the headless backend.
This should use the EGL surfaceless platform and preferably create pbuffer EGLSurface
s for outputs. Using FBOs instead of pbuffers is possible but would probably need more changes in GL-renderer which currently assumes to be dealing with EGLSurface
alone.
There have been thoughts about this for a long time, see #50 (closed) and #122. This issue replaces #50 (closed), but not quite #122.
#50 (closed) had the idea of using render nodes explicitly, and for reasons I've forgot was avoiding the surfaceless platform. The use of GBM platform for this seems kludgy today.
#122 aimed for a nested compositor setup, relying on Mesa to automatically set up a software GL rasteriser when no hardware driver was usable. While that would probably work, it does not allow testing hardware drivers with headless, and it is more complicated to set up and debug if anything goes wrong. The reason why #122 is not completely superseded here is that running some tests nested would still be useful for testing the Wayland backend. That is a whole another topic.