diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-06-25 17:58:13 -0400 |
---|---|---|
committer | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-08-14 01:39:20 -0400 |
commit | 028606512dfe9fe9d565f600669d06c35aa20f3a (patch) | |
tree | 17a1297a2f588b8fd9aa04e829e001fba7594181 | |
parent | f411ca040ebac4cede9862a4d443472c25baccc6 (diff) |
wlr_scene: Add per scene node visibility
-rw-r--r-- | include/wlr/types/wlr_scene.h | 4 | ||||
-rw-r--r-- | types/scene/wlr_scene.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index a8737921..da0a794a 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -64,6 +64,10 @@ struct wlr_scene_node { void *data; struct wlr_addon_set addons; + + // private state + + pixman_region32_t visible; }; enum wlr_scene_debug_damage_option { diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 4f62a882..f4815ece 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -58,6 +58,7 @@ static void scene_node_init(struct wlr_scene_node *node, wl_list_init(&node->link); wl_signal_init(&node->events.destroy); + pixman_region32_init(&node->visible); if (parent != NULL) { wl_list_insert(parent->children.prev, &node->link); @@ -127,6 +128,7 @@ void wlr_scene_node_destroy(struct wlr_scene_node *node) { wlr_addon_set_finish(&node->addons); wl_list_remove(&node->link); + pixman_region32_fini(&node->visible); free(node); } @@ -610,6 +612,9 @@ static void _scene_node_damage_whole(struct wlr_scene_node *node, int width, height; scene_node_get_size(node, &width, &height); + pixman_region32_fini(&node->visible); + pixman_region32_init_rect(&node->visible, lx, ly, width, height); + struct wlr_scene_output *scene_output; wl_list_for_each(scene_output, &scene->outputs, link) { struct wlr_box box = { |