mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Add fast_is<T> optimization for more paintables
We were doing a lot of dynamic_cast with these types, so let's avoid it.
This commit is contained in:
parent
4eca3781c7
commit
84bedebb09
Notes:
github-actions[bot]
2025-09-22 13:02:05 +00:00
Author: https://github.com/awesomekling
Commit: 84bedebb09
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6265
4 changed files with 20 additions and 0 deletions
|
|
@ -45,6 +45,8 @@ public:
|
|||
ReadonlySpan<GC::Ref<PaintableBox>> paintable_boxes_with_auto_content_visibility() const { return m_paintable_boxes_with_auto_content_visibility; }
|
||||
|
||||
private:
|
||||
virtual bool is_viewport_paintable() const override { return true; }
|
||||
|
||||
void build_stacking_context_tree();
|
||||
|
||||
explicit ViewportPaintable(Layout::Viewport const&);
|
||||
|
|
@ -57,4 +59,7 @@ private:
|
|||
Vector<GC::Ref<PaintableBox>> m_paintable_boxes_with_auto_content_visibility;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Paintable::fast_is<ViewportPaintable>() const { return is_viewport_paintable(); }
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue