mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibGfx: Only determine glyphs info once in TextLayout
We were calling into `hb_buffer_get_glyph_infos()` twice and setting up an unused `Vector<hb_glyph_info_t>`.
This commit is contained in:
parent
c91718148d
commit
631c857301
Notes:
github-actions[bot]
2025-06-17 15:04:59 +00:00
Author: https://github.com/gmta
Commit: 631c857301
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5115
1 changed files with 3 additions and 6 deletions
|
@ -59,10 +59,6 @@ NonnullRefPtr<GlyphRun> shape_text(FloatPoint baseline_start, float letter_spaci
|
|||
hb_buffer_add_utf8(buffer, reinterpret_cast<char const*>(string.bytes()), string.byte_length(), 0, -1);
|
||||
hb_buffer_guess_segment_properties(buffer);
|
||||
|
||||
u32 glyph_count;
|
||||
auto* glyph_info = hb_buffer_get_glyph_infos(buffer, &glyph_count);
|
||||
Vector<hb_glyph_info_t> const input_glyph_info({ glyph_info, glyph_count });
|
||||
|
||||
auto* hb_font = font.harfbuzz_font();
|
||||
hb_feature_t const* hb_features_data = nullptr;
|
||||
Vector<hb_feature_t> hb_features;
|
||||
|
@ -81,8 +77,9 @@ NonnullRefPtr<GlyphRun> shape_text(FloatPoint baseline_start, float letter_spaci
|
|||
|
||||
hb_shape(hb_font, buffer, hb_features_data, features.size());
|
||||
|
||||
glyph_info = hb_buffer_get_glyph_infos(buffer, &glyph_count);
|
||||
auto* positions = hb_buffer_get_glyph_positions(buffer, &glyph_count);
|
||||
u32 glyph_count;
|
||||
auto const* glyph_info = hb_buffer_get_glyph_infos(buffer, &glyph_count);
|
||||
auto const* positions = hb_buffer_get_glyph_positions(buffer, &glyph_count);
|
||||
|
||||
Vector<Gfx::DrawGlyph> glyph_run;
|
||||
glyph_run.ensure_capacity(glyph_count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue