mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 22:52:20 +00:00
wlr_scene: Store update box in update data
We'll use it later
This commit is contained in:
parent
4b4ca11f6f
commit
823a64bf7d
@ -271,6 +271,7 @@ static void scene_node_opaque_region(struct wlr_scene_node *node, int x, int y,
|
||||
struct scene_update_data {
|
||||
pixman_region32_t *visible;
|
||||
pixman_region32_t *update_region;
|
||||
struct wlr_box update_box;
|
||||
struct wl_list *outputs;
|
||||
bool calculate_visibility;
|
||||
};
|
||||
@ -514,23 +515,22 @@ static void scene_update_region(struct wlr_scene *scene,
|
||||
pixman_region32_init(&visible);
|
||||
pixman_region32_copy(&visible, update_region);
|
||||
|
||||
struct pixman_box32 *region_box = pixman_region32_extents(update_region);
|
||||
struct scene_update_data data = {
|
||||
.visible = &visible,
|
||||
.update_region = update_region,
|
||||
.outputs = &scene->outputs,
|
||||
.calculate_visibility = scene->calculate_visibility,
|
||||
};
|
||||
|
||||
struct pixman_box32 *region_box = pixman_region32_extents(update_region);
|
||||
struct wlr_box box = {
|
||||
.update_box = {
|
||||
.x = region_box->x1,
|
||||
.y = region_box->y1,
|
||||
.width = region_box->x2 - region_box->x1,
|
||||
.height = region_box->y2 - region_box->y1,
|
||||
},
|
||||
.outputs = &scene->outputs,
|
||||
.calculate_visibility = scene->calculate_visibility,
|
||||
};
|
||||
|
||||
// update node visibility and output enter/leave events
|
||||
scene_nodes_in_box(&scene->tree.node, &box, scene_node_update_iterator, &data);
|
||||
scene_nodes_in_box(&scene->tree.node, &data.update_box, scene_node_update_iterator, &data);
|
||||
|
||||
pixman_region32_fini(&visible);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user