LibGfx+LibWeb: Append glyphs in LineBoxFragment run more efficiently
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

Since we know the number of glyphs we're going to append, ensure the
LineBoxFragment run's capacity once and perform unchecked appends.
This commit is contained in:
Jelle Raaijmakers 2025-06-17 14:40:08 +02:00 committed by Alexander Kalenik
commit 46a46a1c61
Notes: github-actions[bot] 2025-06-17 15:04:38 +00:00
2 changed files with 17 additions and 10 deletions

View file

@ -61,8 +61,6 @@ public:
[[nodiscard]] bool is_empty() const { return m_glyphs.is_empty(); }
[[nodiscard]] float width() const { return m_width; }
void append(DrawGlyph glyph) { m_glyphs.append(glyph); }
private:
Vector<DrawGlyph> m_glyphs;
NonnullRefPtr<Font const> m_font;