mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
wlr_scene: Add per scene node visibility
This commit is contained in:
parent
f411ca040e
commit
028606512d
2 changed files with 9 additions and 0 deletions
|
@ -64,6 +64,10 @@ struct wlr_scene_node {
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
struct wlr_addon_set addons;
|
struct wlr_addon_set addons;
|
||||||
|
|
||||||
|
// private state
|
||||||
|
|
||||||
|
pixman_region32_t visible;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum wlr_scene_debug_damage_option {
|
enum wlr_scene_debug_damage_option {
|
||||||
|
|
|
@ -58,6 +58,7 @@ static void scene_node_init(struct wlr_scene_node *node,
|
||||||
wl_list_init(&node->link);
|
wl_list_init(&node->link);
|
||||||
|
|
||||||
wl_signal_init(&node->events.destroy);
|
wl_signal_init(&node->events.destroy);
|
||||||
|
pixman_region32_init(&node->visible);
|
||||||
|
|
||||||
if (parent != NULL) {
|
if (parent != NULL) {
|
||||||
wl_list_insert(parent->children.prev, &node->link);
|
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);
|
wlr_addon_set_finish(&node->addons);
|
||||||
wl_list_remove(&node->link);
|
wl_list_remove(&node->link);
|
||||||
|
pixman_region32_fini(&node->visible);
|
||||||
free(node);
|
free(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,6 +612,9 @@ static void _scene_node_damage_whole(struct wlr_scene_node *node,
|
||||||
int width, height;
|
int width, height;
|
||||||
scene_node_get_size(node, &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;
|
struct wlr_scene_output *scene_output;
|
||||||
wl_list_for_each(scene_output, &scene->outputs, link) {
|
wl_list_for_each(scene_output, &scene->outputs, link) {
|
||||||
struct wlr_box box = {
|
struct wlr_box box = {
|
||||||
|
|
Loading…
Reference in a new issue