mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-20 06:47:19 -04:00
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:
parent
25bec59c75
commit
8482074473
2 changed files with 91 additions and 1 deletions
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue