Alexander Orzechowski
95062904c7
wlr_scene: Introduce wlr_scene_buffer_set_opacity
2023-05-30 15:43:29 +00:00
Alexander Orzechowski
2346b90a9f
wlr_scene: Make scene_rect_from_node public
...
This is in an effort to be more consistent with both already public
getters: wlr_scene_buffer_from_node and wlr_scene_tree_from_node
2023-05-30 15:40:41 +00:00
Alexander Orzechowski
88f80c4a7c
wlr_scene: Make scene_tree_from_node public
...
This is to allow for compositors that want to be more implicit about
how their scene is organized. Such a compositor may want to walk up
at a certain scene node to find something such as a surface to focus on.
2023-05-30 15:40:41 +00:00
Alexander Orzechowski
61c157269e
wlr_scene: Add documentation to wlr_scene_buffer_from_node
2023-05-30 15:40:41 +00:00
Alexander Orzechowski
3ef9f91283
wlr_scene: Add dmabuf_feedback helper
2023-02-20 17:21:17 -05:00
Alexander Orzechowski
323f0b94db
wlr_scene: Cleanup header includes
...
We don't need to pull wlr_compositor.
2023-02-20 16:53:59 -05:00
Kenny Levinsen
1225f81a6a
scene: Add fractional scale handling
2023-02-08 16:31:39 +01:00
Alexander Orzechowski
7b32c25a4f
wlr_scene: Rename wlr_scene_surface_from_buffer
...
This renames it to wlr_scene_surface_try_from_buffer to be more clear
that this function can return NULL. This is inline with the rest of
wlroots[1].
[1] https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3991
2023-02-04 02:57:42 -05:00
Alexander Orzechowski
5007e713b4
wlr_scene: Send intersecting list of scene outputs for outputs_update signal
2023-01-21 16:23:30 -05:00
Simon Ser
fecbaa2bd6
scene: stop listening for output enable/mode events
...
These will go away.
2022-12-01 20:05:04 +00:00
Kirill Primak
060df4c6c0
scene: introduce wlr_scene_buffer.events.outputs_update
...
This event is useful for e.g. sending the preferred buffer scale to the
client.
2022-11-24 22:28:13 +00:00
Alexander Orzechowski
c8a5dfcc87
wlr_scene: Add drag icon helper
2022-11-14 15:44:43 +00:00
Simon Ser
2b22a10478
scene: constify region APIs
2022-11-11 23:11:17 +00:00
Kenny Levinsen
7c575922c0
wlr_scene: Convert render_list to wl_array
...
This simplifies some of the growth logic, but uses array_realloc to shrink the
array if needed.
2022-08-19 19:38:33 +02:00
Alexander Orzechowski
59675347e6
wlr_scene: Remove unused typedef
2022-08-14 02:38:51 -04:00
Alexander Orzechowski
919e67da7d
wlr_scene: Account for occlusion by other scene nodes when calculating visibility
2022-08-14 02:38:51 -04:00
Alexander Orzechowski
18417026be
wlr_scene: Introduce buffer opaque region metadata
2022-08-14 02:38:50 -04:00
Alexander Orzechowski
0a9a941ba3
wlr_scene: Rewrite direct scan out logic to rely on visibility
...
Also make the regular rendering logic use the introduced
render list.
2022-08-14 02:38:50 -04:00
Alexander Orzechowski
028606512d
wlr_scene: Add per scene node visibility
2022-08-14 01:39:20 -04:00
Alexander Orzechowski
f72aeacd6e
wlr_scene: Add option to disable direct scanout
...
Closes : #3405
Supersedes: !3562
Co-authored-by: Xiao YaoBing <xiaoyaobing@qq.com>
2022-08-08 00:40:21 -04:00
Alexander Orzechowski
5dc1d4671d
wlr_scene: Maintain damage highlight regions per output
...
The logic doesn't support handling multiple outputs so let's not break
the assumption and handle damages per output much like how damage_ring
is done.
2022-07-03 12:21:52 -04:00
Kirill Primak
694b8c6683
scene: add missing output damage listener
...
This is necessary to handle damage coming from the backend and software
cursors.
2022-06-29 21:19:38 +03:00
Kirill Primak
97f0347780
scene: switch to wlr_damage_ring
2022-06-29 18:54:27 +03:00
Kirill Primak
0c2eed533e
scene/output-layout: improve ownership logic
...
This commit ensures that outputs that weren't created by the output
layout helper aren't destroyed on the output layout change.
Consider the following piece of logic:
// struct wlr_output *o1, *o2;
// struct wlr_scene *scene;
// struct wlr_output_layout *layout;
wlr_scene_attach_output_layout(scene, layout);
wlr_output_layout_add_auto(layout, o1);
struct wlr_scene_output *so2 = wlr_scene_output_create(scene, o2);
wlr_output_layout_move(layout, o1, 100, 200);
// so2 is invalid now
2022-06-01 09:49:25 +00:00
Kirill Primak
d3bc17d5d1
scene: add wlr_scene_output.events.destroy
2022-06-01 09:49:25 +00:00
Kirill Primak
ec328ca8cc
scene/wlr_scene.h: fix indentation
2022-05-31 20:34:50 +03:00
Alexander Orzechowski
71f8a48d38
wlr_scene: Move children list from wlr_scene_node to wlr_scene_tree
2022-05-31 09:14:28 +00:00
Alexander Orzechowski
cb2dbc327e
wlr_scene: Inline wlr_scene_node_state
...
This seems like nothing interesting was done with this. Let's simplify
and allow us some flexibility in the future.
2022-05-31 09:14:28 +00:00
Alexander Orzechowski
ccd0f85c2a
wlr_scene: Only allow parenting on a wlr_scene_tree
2022-05-31 09:14:28 +00:00
Alexander Orzechowski
9eb71146ae
wlr_scene: Refactor wlr_scene (the root element) to encase a wlr_scene_tree
...
Co-authored-by: Isaac Freund <mail@isaacfreund.com>
2022-05-31 09:14:28 +00:00
Simon Ser
28d89779af
Reformat doc comments
...
Unify the way we document our APIs. See CONTRIBUTING.md for the
rules.
2022-05-25 14:22:58 +00:00
Alexander Orzechowski
41124592dd
wlr_scene: Hook up HIGHLIGHT logic
...
This will display red translucent rectangles on the screen regions that
have been damaged. These rectangles will fade out over the span of 250
msecs. If the area is damaged again while the region is fading out,
the timer is reset.
Let's also disable direct scan out when this option is enabled, or else
we won't be able to render the highlight damage regions.
2022-05-23 15:58:49 -04:00
Alexander Orzechowski
17f5414b1a
wlr_scene: Parse out WLR_SCENE_DEBUG_DAMAGE
2022-05-23 15:43:18 -04:00
Alexander Orzechowski
dc9bc5683a
wlr_scene: Refactor wlr_scene_surface to be a helper on top of wlr_scene_buffer
2022-05-19 14:26:50 -04:00
Alexander Orzechowski
5f43e1732a
wlr_scene: Introduce addons to scene nodes
2022-05-19 14:25:34 -04:00
Alexander Orzechowski
f2dbcc3358
wlr_scene: Make presentation object public
2022-05-19 14:24:05 -04:00
Alexander Orzechowski
20cc1ce0b9
wlr_scene: Change out surface specific iterator functions
...
Instead iterate over wlr_scene_buffer
2022-05-19 14:24:05 -04:00
Alexander Orzechowski
39c059b70e
wlr_scene: Make scene_buffer_from_node public
2022-05-19 14:24:05 -04:00
Alexander Orzechowski
73a656e8ac
wlr_scene: Add a function to also specify damage when applying a buffer to wlr_scene_buffer
2022-05-19 14:24:05 -04:00
Alexander Orzechowski
34be5da072
wlr_scene: Add a way to choose when input interactions happen on a buffer
2022-05-19 14:24:05 -04:00
Alexander Orzechowski
09c7fe0f90
wlr_scene: Add frame_done signal for wlr_scene_buffer
...
Let's also change the name of the function. Motivation [1].
[1] https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3496#note_1357824
2022-05-19 14:23:10 -04:00
Alexander Orzechowski
a53eccf2af
wlr_scene: Add primary_output property to wlr_scene_buffer
2022-05-19 14:21:22 -04:00
Alexander Orzechowski
dfeb1309a8
wlr_scene: Add presentation signal for wlr_scene_buffer
2022-05-19 14:21:21 -04:00
Alexander Orzechowski
7e383c6a6a
wlr_scene: Make wlr_scene_render_output private
...
This function sidesteps damage tracking and output awareness on
buffers/surfaces. This function isn't a great fit for the API.
Let's also inline the function and simplify it.
2022-05-19 14:17:51 -04:00
Alexander Orzechowski
933ff0e60c
wlr_scene: Fix missing calls to scene_node_update_outputs
...
There were a couple places this was missing
- on mode change of an output. If the resolution changes for example
nodes may fall out of the view.
- on commits on an output for scale or transform changes
- when the transform of a buffer is changed. If the dest size is not
set, the buffer may have been rotated potentially changing its size
if the buffer width != height
2022-05-19 14:17:51 -04:00
Alexander Orzechowski
c46b53d0b0
wlr_scene: Add output_enter/output_leave signals
...
When we destroy a scene buffer, let's make sure that we call
output_leave signals before we finish the node which will call destroy
listeners.
2022-05-19 14:17:51 -04:00
Alexander Orzechowski
61dab42c70
wlr_scene: Add setter for buffer of a wlr_scene_buffer
2022-05-19 14:17:51 -04:00
Alexander Orzechowski
039a31df9a
wlr_scene: Allow buffer in wlr_scene_buffer to be NULL
...
This is useful to emulate an unmapped surface.
2022-05-19 14:16:52 -04:00
Simon Ser
68f2f8cf92
Revert "scene: try to import buffers as textures before rendering"
...
This reverts commit 3db1bcbe64
.
Since [1], importing buffers as textures before wlr_renderer_begin isn't
necessary anymore.
[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3464
2022-03-16 16:42:45 +00:00
Kenny Levinsen
1e3662ce57
scene: Add layer_shell_v1 helper
...
This helper behaves similar to the xdg_shell helper, and additionally
provides a little assistance for positioning and exclusive_zone
management.
2022-02-01 13:31:26 +01:00