render: interface is inefficient for software renderers
The current wlr_renderer
API has been designed with only OpenGL in mind and is inefficient for software renderers.
The main pain point is that it allows for arbitrary rotations. render_subtexture_with_matrix
and render_quad_with_matrix
take an arbitrary 3x3 matrix. While the Pixman renderer can handle translations, scaling, and rotations when they are multiples of 90 degrees, it cannot handle other rotations like a 27 degree one.
Arbitrary rotations aren't really useful in general, especially considering that the KMS API and the upcoming scene-graph API (https://github.com/swaywm/wlroots/issues/1826) don't support them. Maybe they should get nuked from the renderer API. Compositors that need more complicated rendering can always sling GL shaders themselves.
It's not yet clear if and how 3x3 matrices should get replaced. Matrices are great at composing transformations, e.g. accumulating output scale + output rotation + translation + surface scale + surface rotation + surface viewport.
cc @bl4ckb0ne