Commit Graph

28 Commits

Author SHA1 Message Date
Isaac Freund fecde72be3 scene: add wlr_scene_send_frame_done() 2021-12-13 15:21:05 +00:00
Isaac Freund fb1f613510 scene: add primary output to wlr_scene_surface
This allows compositors to avoid sending multiple frame done events
to a surface that is rendered on multiple outputs at once. This may
also be used in the same way for presentation feedback.
2021-12-13 15:21:05 +00:00
Isaac Freund 0215dffba5 scene: send surface enter/leave output events
Co-authored-by: Simon Ser <contact@emersion.fr>
2021-12-13 15:21:05 +00:00
Simon Ser ba974a4e9f scene: add wlr_scene_get_scene_output
This allows getting a wlr_scene_output from a wlr_output. Since an
output can only be added once to a scene-graph there's no ambiguity.

This is useful for compositors using wlr_scene_attach_output_layout:
the output layout integration automatically creates a scene-graph
output for each wlr_output added to the layout.
2021-11-30 20:16:24 +00:00
Simon Ser 585a908a01 scene: add wlr_scene_xdg_surface_create
This allows compositors to easily add an xdg_surface to the
scene-graph while retaining the ability to unconstraint popups
and decide their final position.

Compositors can handle new popups with the wlr_xdg_shell.new_surface
event, get the parent scene-graph node via wlr_xdg_popup.parent.data,
create a new scene-graph node via wlr_scene_xdg_surface_tree_create,
and unconstraint the popup if they want to.
2021-11-25 18:53:12 +01:00
Simon Ser a4ccca0834 scene: add support for direct scan-out
Check if only a single node intersects with the output viewport
and all of its properties match. In this case, attempt direct
scan-out.
2021-10-23 00:49:07 +02:00
Simon Ser db4c93028d scene: add wlr_scene_output_for_each_surface
This allows compositors to more easily implement sending
wl_surface.frame callback done events.
2021-10-22 22:29:35 +02:00
Isaac Freund 4fae8f7be3 scene: add functions to place node on top/bottom
These are very common operations for compositors (including tinywl)
to perform.
2021-10-14 21:10:03 +02:00
Isaac Freund 2a8d385386 scene: assert that node != sibling in place above/below
Currently these functions remove the node from the scene if the sibling
argument is the same node as the node. To prevent confusion when
misusing this API, assert that the nodes are distinct and document this.
2021-10-14 21:10:03 +02:00
Simon Ser 3c26244340 scene: add wlr_scene_buffer_set_transform 2021-09-22 10:45:39 -06:00
Simon Ser 43833fba64 scene: add wlr_scene_buffer_set_dest_size 2021-09-22 10:45:39 -06:00
Simon Ser 63040d6744 scene: add wlr_scene_buffer_set_source_box 2021-09-22 10:45:39 -06:00
Simon Ser 7939bf8cc6 scene: add wlr_scene_buffer
This new scene-graph node displays a wlr_buffer.

Closes: https://github.com/swaywm/wlroots/issues/3161
2021-09-22 10:45:39 -06:00
Simon Ser 2e590026e9 scene: add wlr_scene_subsurface_tree_create 2021-09-21 16:48:31 +02:00
Simon Ser 211b3b760e scene: add wlr_scene_tree 2021-09-21 16:48:31 +02:00
Simon Ser a181a37b12 scene: add wlr_scene_attach_output_layout
This is a helper to integrate wlr_scene with wlr_output_layout.
2021-09-09 12:04:35 +02:00
Simon Ser 44f0f7a0a7 scene: add damage tracking support 2021-09-08 09:50:08 -04:00
Simon Ser 9195b77e14 scene: add wlr_scene_node_coords 2021-09-08 09:50:08 -04:00
Simon Ser 04d105760d scene: add wlr_scene_output_commit 2021-09-08 09:50:08 -04:00
Simon Ser 968c1df7e9 scene: add scene outputs
These allow describing an output's viewport inside the scene-graph.
2021-09-08 09:50:08 -04:00
Devin J. Pohly 9ed16e39fa scene: replace surface_at() with node_at()
With the addition of a non-surface node type, it was unclear how such
nodes should interact with scene_node_surface_at().  For example, if the
topmost node at the given point is a RECT, should the function treat
that node as transparent and continue searching, or as opaque and return
(probably) NULL?

Instead, replace the function with one returning a scene_node, which
will allow for more consistent behavior across different node types.
Compositors can downcast scene_surface nodes via the now-public
wlr_scene_surface_from_node() if they need access to the surface itself.
2021-09-02 19:05:02 +02:00
Devin J. Pohly b7cd06e8fa scene: add RECT node type
RECT is a solid-colored rectangle, useful for simple borders or other
decoration.  This can be rendered directly using the wlr_renderer,
without needing to create a surface.
2021-09-02 19:05:02 +02:00
Devin J. Pohly 526652a554 scene: iterate nodes instead of surfaces when rendering
This will allow us to create node types which are rendered but not
surface-based, such as a solid color or image.
2021-09-02 19:05:02 +02:00
Devin J. Pohly a1d462fa81 scene: add node reparent function
If nodes are arranged in a tree rather than at a single level, then it
makes sense that there should be a way to move them to a completely
different parent in addition to moving up or down among siblings.
2021-08-30 16:43:18 +02:00
Simon Ser e4d0ec9ee1 scene: add wlr_scene_node_surface_at 2021-08-26 21:12:28 +02:00
Simon Ser 501b29db03 scene: add user data pointer to wlr_scene_node
This allows compositors to attach arbitrary data to the scene-graph
nodes.
2021-08-26 21:12:28 +02:00
Simon Ser 86e9309808 scene: add wlr_scene_node_toggle
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.
2021-08-26 21:12:28 +02:00
Simon Ser c7d489b5b6 Introduce new scene-graph API
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]: https://github.com/swaywm/wlroots/issues/1826#issuecomment-564601757
2021-08-26 21:12:28 +02:00