1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibWeb: Don't pass StringView to RecordingPainter, to avoid copy

Instead, we now pass String if we have one. In particular, this fixes an
issue where image elements with a data: URL src would copy the entire
URL string every time we painted (before the image had been decoded).
This was very noticeable on "fully downloaded" web pages where every
single image has been turned into a data: URL.
This commit is contained in:
Andreas Kling 2023-12-27 10:37:13 +01:00
parent 0c7b1d27b4
commit bd9989b08a
5 changed files with 10 additions and 10 deletions

View file

@ -281,7 +281,7 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const
else
builder.append(layout_box().debug_description());
builder.appendff(" {}x{} @ {},{}", border_rect.width(), border_rect.height(), border_rect.x(), border_rect.y());
auto size_text = builder.to_byte_string();
auto size_text = MUST(builder.to_string());
auto size_text_rect = border_rect;
size_text_rect.set_y(border_rect.y() + border_rect.height());
size_text_rect.set_top(size_text_rect.top());