Skip to content

Draft: Integrate cursor layers into compositor

Vlad Zahorodnii requested to merge work/zzag/compositor-cursor-layer into master

Disclaimer: I'm still figuring things out. In particular, the data structures, coordinate systems, etc.

This unifies handling of primary and cursor layers. The output layer update algorithm looks as follow

  • update output layer properties
  • call prepare(), the output backend tests the properties; atm we just ensure that the cursor size doesn't exceed cursor size caps
  • reassign render layers to output layers
  • walk render layer forest and update output layer contents
  • call present() to finally present new screen contents

The update algorithm is not final and I expect it to change in the future.

The coordinate system used in output layers is still an open question. There are two options: one is logical coordinate system, the other one is the native coordinate system. The main advantage of the native coordinate system is that we could pass through layer bounds to the DRM backend. The main con of the native coordinate system is the handling of the cursor plane, specifically the fact that the allocated buffer can be larger than the requested layer size and we may need to rotate it.

The main advantage of the logical coordinate system is that it's more convenient. The main con of the logical coordinate system is that we need to track "shadow" geometry in the native coordinate system.

At the moment, output layers use the logical coordinate system. The DRM backend and other backends convert logical coordinate system to native coordinate system where it's needed.

Clearing cursor layer is a bit tricky too. When using software cursor, the cursor layer should not call glClear(). On the other hand, when using hardware cursor, we must do that. At the moment, I added a superlayer check. It breaks the original design goals though, the assignment of the cursor render layer to output layer is not transparent anymore. There are ways around it that employ using an fbo. It needs more R&D.

Merge request reports