1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:27:45 +00:00

LibWeb: Remove glyph run allocation in RecordingPainter::draw_text_run

Instead of allocating a new glyph run solely to shift each glyph by the
painter's offset, this offset could be encoded in a paint command and
applied later during command execution.
This commit is contained in:
Aliaksandr Kalenik 2024-03-01 13:22:35 +01:00 committed by Andreas Kling
parent 79fd8eb28d
commit aeb5a0d9e8
8 changed files with 21 additions and 16 deletions

View file

@ -87,7 +87,7 @@ void CommandList::execute(CommandExecutor& executor)
auto result = command.visit(
[&](DrawGlyphRun const& command) {
return executor.draw_glyph_run(command.glyph_run, command.color);
return executor.draw_glyph_run(command.glyph_run, command.color, command.translation);
},
[&](DrawText const& command) {
return executor.draw_text(command.rect, command.raw_text, command.alignment, command.color,