LibWeb: Store visual context nodes in arena-based tree

Replace per-node heap-allocated AtomicRefCounted
AccumulatedVisualContext objects with a single contiguous Vector inside
AccumulatedVisualContextTree. All nodes for a frame are now stored in
one allocation, using type-safe VisualContextIndex instead of RefPtr
pointers.

This reduces allocation churn, improves cache locality, and opens the
door for future snapshotting of visual context state — similar to how
scroll offsets are snapshotted today.
This commit is contained in:
Aliaksandr Kalenik
2026-03-11 00:21:46 +01:00
committed by Alexander Kalenik
parent 834675aea3
commit 9d2ebe90ed
Notes: github-actions[bot] 2026-03-11 10:17:47 +00:00
20 changed files with 258 additions and 207 deletions

View File

@@ -101,7 +101,7 @@ Optional<Gfx::ImageCursor> CursorStyleValue::make_image_cursor(Layout::NodeWithS
painter->clear_rect(bitmap.rect().to_type<float>(), Color::Transparent);
// Paint the cursor into a bitmap.
auto display_list = Painting::DisplayList::create();
auto display_list = Painting::DisplayList::create(Painting::AccumulatedVisualContextTree::create());
Painting::DisplayListRecorder display_list_recorder(display_list);
DisplayListRecordingContext paint_context { display_list_recorder, document.page().palette(), document.page().client().device_pixels_per_css_pixel(), document.page().chrome_metrics() };