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

LibWeb: cache in-process decoded images in ImageResource

Otherwise cloned Bitmaps returned by the decoder will be prematurely
freed
This commit is contained in:
Peter Nelson 2020-09-12 12:36:36 +01:00 committed by Andreas Kling
parent 16ebbde26f
commit 9494b03a02
2 changed files with 5 additions and 5 deletions

View file

@ -115,7 +115,7 @@ void LayoutImage::paint(PaintContext& context, PaintPhase phase)
if (alt.is_empty())
alt = image_element.src();
context.painter().draw_text(enclosing_int_rect(absolute_rect()), alt, Gfx::TextAlignment::Center, specified_style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black), Gfx::TextElision::Right);
} else if (auto* bitmap = m_image_loader.bitmap()) {
} else if (auto bitmap = m_image_loader.bitmap()) {
context.painter().draw_scaled_bitmap(enclosing_int_rect(absolute_rect()), *bitmap, bitmap->rect());
}
}