Files
ladybird/Libraries/LibWeb/Painting/ScrollFrame.cpp
Aliaksandr Kalenik 3012c0fe72 LibWeb: Store scroll frames by value in contiguous storage
Replace per-frame heap-allocated RefCounted ScrollFrame objects with a
single contiguous Vector<ScrollFrame> inside ScrollState. All frames for
a viewport are now stored in one allocation, using type-safe
ScrollFrameIndex instead of RefPtr pointers.

This reduces allocation churn, improves cache locality, and moves
parent-chain traversal (cumulative offset, nearest scrolling ancestor)
into ScrollState — similar to how visual context nodes were recently
consolidated into AccumulatedVisualContextTree.
2026-03-12 12:06:40 +01:00

22 lines
497 B
C++

/*
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGC/Heap.h>
#include <LibGC/WeakInlines.h>
#include <LibWeb/Painting/PaintableBox.h>
#include <LibWeb/Painting/ScrollFrame.h>
namespace Web::Painting {
ScrollFrame::ScrollFrame(PaintableBox const& paintable_box, bool sticky, ScrollFrameIndex parent_index)
: m_paintable_box(paintable_box)
, m_sticky(sticky)
, m_parent_index(parent_index)
{
}
}