This repository was archived by the owner on Nov 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 341
Outputs layers + scene-graph #2165
Draft
emersion
wants to merge
9
commits into
swaywm:master
Choose a base branch
from
emersion:output-layers-scenegraph
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
f686747
to
606d6f9
Compare
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Some more features could be added to
wlr_scene
(without any need to change the scene-graph example/compositor):