Layer based compositing
The screen normally contains windows, but it can also include other types of overlay items, e.g. the software cursor, the screen edge glow, the track mouse indicator, etc. Restructuring compositing in layers would help us to implement those things more cleanly. It also aligns with one of the scene redesign's goals - better utilization of hardware planes.
We would need a composite/render layer type, e.g. RenderLayer
. The RenderLayer
has a layer delegate - the Scene
. The render layers may form a tree and they can be dynamically allocated based on the compositor's needs, for example the screen edge effect would create a render layer for every reserved screen edge, etc.
Since the render layers can be dynamically allocated and the hardware layers are finite. There are two options - split render layers and output layers in separate trees or use the same layer type for render and output layer types and differentiate between the ones that are backed by hw layers and the ones that are not. Prior art: SurfaceFlinger and hwcomposer.
In a way, it depends on us decoupling the legacy scene from the rest of kwin and slimming down the effect layer as everything is still too coupled at the moment.