wlr_scene: Add bounding-box caching

Optimizes _scene_nodes_in_box() by caching bounding box information for nodes
in the scene. With this change I'm able to spawn 100 xterm windows and alt+tab
in labwc without experiencing a multi-second hang during scene traversal.
This commit is contained in:
Liam Middlebrook 2026-02-18 13:46:40 -08:00
parent 25bec59c75
commit 8482074473
2 changed files with 91 additions and 1 deletions

View file

@ -92,6 +92,12 @@ struct wlr_scene_tree {
struct wlr_scene_node node;
struct wl_list children; // wlr_scene_node.link
struct {
// Cached bounding box for optimized scene traversal
struct wlr_box bbox;
bool bbox_valid;
} WLR_PRIVATE;
};
/** The root scene-graph node. */