mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
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.
22 lines
497 B
C++
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)
|
|
{
|
|
}
|
|
|
|
}
|