mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +00:00
LibWeb: Have ImageProvider bitmap getter take optional size argument
This allows the painting subsystem to request a bitmap with the exact size needed for painting, instead of being limited to "just give me a bitmap" (which was perfectly enough for raster images, but not for vector graphics).
This commit is contained in:
@@ -132,10 +132,10 @@ Optional<float> HTMLImageElement::intrinsic_aspect_ratio() const
|
||||
return {};
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap const> HTMLImageElement::current_image_bitmap() const
|
||||
RefPtr<Gfx::Bitmap const> HTMLImageElement::current_image_bitmap(Gfx::IntSize size) const
|
||||
{
|
||||
if (auto data = m_current_request->image_data())
|
||||
return data->bitmap(m_current_frame_index);
|
||||
return data->bitmap(m_current_frame_index, size);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user