LibWeb: Remove glyph run allocation in paint_text_fragment()

Instead of allocating a new glyph run to scale glyph positions and
fonts, a scale factor could be encoded in a paint command and applied
later during command execution.
This commit is contained in:
Aliaksandr Kalenik 2024-03-01 14:14:47 +01:00 committed by Andreas Kling
commit cf6999f5f3
Notes: sideshowbarker 2024-07-16 22:16:50 +09:00
11 changed files with 25 additions and 27 deletions

View file

@ -11,12 +11,8 @@ namespace Web::Painting {
void DrawGlyphRun::translate_by(Gfx::IntPoint const& offset)
{
for (auto& glyph : glyph_run) {
glyph.visit([&](auto& glyph) {
glyph.translate_by(offset.to_type<float>());
});
}
rect.translate_by(offset);
translation.translate_by(offset.to_type<float>());
}
Gfx::IntRect PaintOuterBoxShadow::bounding_rect() const