LibWeb: Save Gfx::ImmutableBitmap in ApplyBitmapMask display list item

This allows to delete duplicated code between DisplayListPlayerSkia.cpp
and ImmutableBitmap.cpp responsible for wrapping Gfx::Bitmap in SkImage.
This commit is contained in:
Aliaksandr Kalenik 2024-11-10 01:50:09 +01:00 committed by Alexander Kalenik
commit 68f58b23ce
Notes: github-actions[bot] 2024-11-10 16:21:25 +00:00
9 changed files with 10 additions and 45 deletions

View file

@ -73,7 +73,7 @@ Optional<Gfx::Bitmap::MaskKind> SVGMaskable::get_mask_type_of_svg() const
return {};
}
RefPtr<Gfx::Bitmap> SVGMaskable::calculate_mask_of_svg(PaintContext& context, CSSPixelRect const& masking_area) const
RefPtr<Gfx::ImmutableBitmap> SVGMaskable::calculate_mask_of_svg(PaintContext& context, CSSPixelRect const& masking_area) const
{
auto const& graphics_element = verify_cast<SVG::SVGGraphicsElement const>(*dom_node_of_svg());
auto mask_rect = context.enclosing_device_rect(masking_area);
@ -108,7 +108,7 @@ RefPtr<Gfx::Bitmap> SVGMaskable::calculate_mask_of_svg(PaintContext& context, CS
if (!mask_bitmap)
mask_bitmap = clip_bitmap;
}
return mask_bitmap;
return Gfx::ImmutableBitmap::create(*mask_bitmap);
}
}