- Moves `Transform` into utils::geometry
- Changes conversion from and into buffer-coordinates to take
`Transform` arguments.
- `Renderer` take `Buffer`-space damage now
- buffer_transform is taken into account everywhere
We make no guarantees about the buffer contents after a fresh allocation
in smithay anyway, so to avoid expensive recreation of a bunch of
resources, try to keep the buffers on reset and just wipe all its
metadata (most importantly the age).
Up until now we always redrew the whole windows, which worked
fine - except for some transparency issues - but left performance
on the table.
So now we use instancing to render only the actually damaged regions
inside the window, which also fixes our few rendering issues.
We also use a shader now for clearing the screen to use instancing as
well and lower the amount of draw calls at the begin of a frame for
clearing parts of it.
And while we are add it we remove the last rendering artifacts
by optimizing the damage vector by deduplicating and merging rectangles.
Older dri3 versions (< 1.2) do only support dmabufs with one plane.
Lets limit the modifiers early, if we detect that, so we do not end
up allocating buffers the interface does not accept.
Some events (especially from xinput) cannot be cleanly mapped to a window.
Instead of requiring every event to come with a `Window` reference, move
the window into those events, that have one.
The current code always acquires the buffer it just submitted,
which results in always rendering to a buffer with age "1", although
its contents are older, because the currently held buffer is already
submitted, just not to the swapchain. When it finally is submitted
its age is again set to 1, the other gets its correct age (but too late)
and the circle is repeated again. So lets fix that.
Slots with an age of 0 were never rendered to. This means
we should not increase their age, when others are submitted
or the renderer might wrongfully assume usuable contents are
available in the buffer.
Refactors the `X11Surface` to use the `Swapchain` internally,
which gives us a buffer age implemenation, which we can then use
to change the `Present` struct of the X11 backend to provide age
values to the user.
This change also merged the `Present` struct into the surface
because submits should now happen explicitly via a new `submit`-call
instead of being submitted implicitly on drop.
This allows the buffer to be discarded if rendering fails.