diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-08-16 07:03:22 -0400 |
---|---|---|
committer | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-08-19 16:18:11 -0400 |
commit | 4d4f823263031cbef06f51547a5fe476e2eb5e38 (patch) | |
tree | 959aec154400055d6d3cf3d93cb45f0ee5893c1c | |
parent | 7c575922c05e4d5fd9a403c2aa631a54c7531d44 (diff) |
wlr_scene: Simplify calculate_visibilty option
-rw-r--r-- | types/scene/wlr_scene.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 79701ab3..ddd09a35 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -398,15 +398,13 @@ static bool scene_node_update_iterator(struct wlr_scene_node *node, struct wlr_box box = { .x = lx, .y = ly }; scene_node_get_size(node, &box.width, &box.height); + pixman_region32_subtract(&node->visible, &node->visible, data->update_region); + pixman_region32_union(&node->visible, &node->visible, data->visible); + pixman_region32_intersect_rect(&node->visible, &node->visible, + lx, ly, box.width, box.height); + if (data->calculate_visibility) { - pixman_region32_subtract(&node->visible, &node->visible, data->update_region); - pixman_region32_union(&node->visible, &node->visible, data->visible); - pixman_region32_intersect_rect(&node->visible, &node->visible, - lx, ly, box.width, box.height); scene_node_cull_hidden(node, lx, ly, data->visible); - } else { - pixman_region32_fini(&node->visible); - pixman_region32_init_rect(&node->visible, lx, ly, box.width, box.height); } update_node_update_outputs(node, data->outputs, NULL); |