mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Use new DecodedImageData::paint() API in ImageStyleValue
This commit is contained in:
parent
4c2a02370d
commit
213e20c97b
Notes:
github-actions[bot]
2025-11-05 08:12:58 +00:00
Author: https://github.com/awesomekling
Commit: 213e20c97b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6699
Reviewed-by: https://github.com/kalenikaliaksandr
1 changed files with 8 additions and 5 deletions
|
|
@ -152,11 +152,14 @@ Optional<CSSPixelFraction> ImageStyleValue::natural_aspect_ratio() const
|
|||
|
||||
void ImageStyleValue::paint(DisplayListRecordingContext& context, DevicePixelRect const& dest_rect, CSS::ImageRendering image_rendering) const
|
||||
{
|
||||
if (auto const* b = bitmap(m_current_frame_index, dest_rect.size().to_type<int>()); b != nullptr) {
|
||||
auto scaling_mode = to_gfx_scaling_mode(image_rendering, b->rect(), dest_rect.to_type<int>());
|
||||
auto dest_int_rect = dest_rect.to_type<int>();
|
||||
context.display_list_recorder().draw_scaled_immutable_bitmap(dest_int_rect, dest_int_rect, *b, scaling_mode);
|
||||
}
|
||||
auto image_data = this->image_data();
|
||||
if (!image_data)
|
||||
return;
|
||||
|
||||
auto rect = image_data->frame_rect(m_current_frame_index).value_or(dest_rect.to_type<int>());
|
||||
auto scaling_mode = to_gfx_scaling_mode(image_rendering, rect, dest_rect.to_type<int>());
|
||||
auto dest_int_rect = dest_rect.to_type<int>();
|
||||
image_data->paint(context, m_current_frame_index, dest_int_rect, dest_int_rect, scaling_mode);
|
||||
}
|
||||
|
||||
Gfx::ImmutableBitmap const* ImageStyleValue::current_frame_bitmap(DevicePixelRect const& dest_rect) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue