Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Outputs layers + scene-graph #2165

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

emersion
Copy link
Member

@emersion emersion commented May 6, 2020

Depends on #1985 and #1966

This PR builds on top of the basic output layers and scene-graph PRs to add more features. I guess the main exciting thing is the new scene-graph example, which will transparently use output-layers instead of rendering if possible (currently only with the Wayland backend).

To test:

examples/scene-graph -s 'weston-simple-egl & weston-simple-dmabuf-egl'

Some more features could be added to wlr_scene (without any need to change the scene-graph example/compositor):

  • Display subsurfaces with output layers
  • Damage tracking

emersion added 8 commits May 6, 2020 15:30
A new wlr_scene API has been added, following the design ideas from [1].
The new API contains the minimal set of features required to make the
API useful. The goal is to design a solid fundation and add more
features in the future.

[1]: swaywm#1826 (comment)
This new API allows compositors to display buffers without needing to
perform rendering operations. This API can be implemented on Wayland
using subsurfaces and on DRM using KMS planes.

The goal is to make use of this API in a future scene-graph API.

References: swaywm#1826
The output layer API is implemented using subsurfaces. I chose to
implement this API in the Wayland backend before doing so in the DRM
backend, because it's way easier on Wayland. On DRM, one needs to figure
out how buffers can be mapped to KMS planes (libliftoff can help) and
perform atomic test-only commits (our current DRM backend isn't ready
for this).
This new example demonstrates how to use the wlr_output_layer API. It's
a compositor that displays all client surfaces using wlr_output_layer.
To test, one can for instance run:

    build/examples/output-layers -s 'weston-simple-dmabuf-egl & weston-simple-egl'

Under the Wayland backend (where layers work as long as clients use
DMA-BUFs), this should display two surfaces with remote wl_subsurfaces.
This function performs an output commit. Since it's higher level than
wlr_scene_render, it can take care of damage tracking and output layers.
This allows compositors to easily enable or disable a scene-graph node.
This can be used to show/hide a surface when the xdg_surface is
mapped/unmapped.
@emersion emersion force-pushed the output-layers-scenegraph branch from f686747 to 606d6f9 Compare May 6, 2020 16:56
@emersion emersion requested review from ascent12 and ddevault and removed request for ascent12 May 6, 2020 17:00
@emersion
Copy link
Member Author

emersion commented Nov 1, 2021

wlroots has migrated to gitlab.freedesktop.org. This pull request has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2165

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant