wlr_scene: Maintain one render_list per scene

Since we're now adding every node into the tree into the render_list,
the length won't change depending on the output.
This commit is contained in:
Alexander Orzechowski 2023-03-10 13:14:51 +01:00
parent 83804b8871
commit e052f12630
2 changed files with 5 additions and 4 deletions

View file

@ -106,6 +106,8 @@ struct wlr_scene {
enum wlr_scene_debug_damage_option debug_damage_option;
bool direct_scanout;
bool calculate_visibility;
struct wl_array render_list;
};
/** A scene-graph node displaying a single surface. */
@ -200,8 +202,6 @@ struct wlr_scene_output {
struct wl_listener output_needs_frame;
struct wl_list damage_highlight_regions;
struct wl_array render_list;
};
/** A layer shell scene helper */

View file

@ -122,6 +122,8 @@ void wlr_scene_node_destroy(struct wlr_scene_node *node) {
wl_list_remove(&scene->presentation_destroy.link);
wl_list_remove(&scene->linux_dmabuf_v1_destroy.link);
wl_array_release(&scene->render_list);
} else {
assert(node->parent);
}
@ -1335,7 +1337,6 @@ void wlr_scene_output_destroy(struct wlr_scene_output *scene_output) {
wl_list_remove(&scene_output->output_damage.link);
wl_list_remove(&scene_output->output_needs_frame.link);
wl_array_release(&scene_output->render_list);
free(scene_output);
}
@ -1585,7 +1586,7 @@ bool wlr_scene_output_commit(struct wlr_scene_output *scene_output) {
return true;
}
struct wl_array *render_list = &scene_output->render_list;
struct wl_array *render_list = &scene_output->scene->render_list;
render_list->size = 0;
struct wlr_box box = { .x = scene_output->x, .y = scene_output->y };