Re-think the way outputs are updated
Currently, the output backend (through render backends) manages some hidden pending state. Output
manages some pending state too, e.g. Output::setContentType()
. Furthermore, RenderLoop
is used for that too, which was not the goal when it was first introduced, it's merely a smart QTimer
that helps us to schedule frames.
In order to reduce the fragmentation, I think it's worth rethinking how output updates are performed. As a rough idea, we could introduce an object to encapsulate output updates, e.g. OutputUpdate
. An OutputUpdate
would store the pending state, i.e. buffers, vrr enabled status, tearing control status, content type, and possibly other state. Compositor::composite()
incrementally builds the next output update and then it commits the pending state in one go.