mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb: Avoid unnecessary Vector copying when generating line boxes
Carry the same Vector<Gfx::DrawGlyphOrEmoji> all the way from the inline level iterator to the final line box fragment.
This commit is contained in:
parent
f48024c2d1
commit
9af966f87d
Notes:
sideshowbarker
2024-07-17 12:02:22 +09:00
Author: https://github.com/awesomekling
Commit: 9af966f87d
Pull-request: https://github.com/SerenityOS/serenity/pull/23708
Reviewed-by: https://github.com/kalenikaliaksandr ✅
5 changed files with 8 additions and 9 deletions
|
@ -97,9 +97,9 @@ void LineBuilder::append_box(Box const& box, CSSPixels leading_size, CSSPixels t
|
|||
};
|
||||
}
|
||||
|
||||
void LineBuilder::append_text_chunk(TextNode const& text_node, size_t offset_in_node, size_t length_in_node, CSSPixels leading_size, CSSPixels trailing_size, CSSPixels leading_margin, CSSPixels trailing_margin, CSSPixels content_width, CSSPixels content_height, Span<Gfx::DrawGlyphOrEmoji> glyph_run)
|
||||
void LineBuilder::append_text_chunk(TextNode const& text_node, size_t offset_in_node, size_t length_in_node, CSSPixels leading_size, CSSPixels trailing_size, CSSPixels leading_margin, CSSPixels trailing_margin, CSSPixels content_width, CSSPixels content_height, Vector<Gfx::DrawGlyphOrEmoji> glyph_run)
|
||||
{
|
||||
ensure_last_line_box().add_fragment(text_node, offset_in_node, length_in_node, leading_size, trailing_size, leading_margin, trailing_margin, content_width, content_height, 0, 0, glyph_run);
|
||||
ensure_last_line_box().add_fragment(text_node, offset_in_node, length_in_node, leading_size, trailing_size, leading_margin, trailing_margin, content_width, content_height, 0, 0, move(glyph_run));
|
||||
m_max_height_on_current_line = max(m_max_height_on_current_line, content_height);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue