mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibWeb: Add optimized painting command for repeated background
With this change, instead of recording a display list item for each instance of a repeated background, a new DrawRepeatedImmutableBitmap type is used. This allows the painter to use optimized repeated image painting and, when the GPU backend is used, avoid re-uploading the image texture for each repetition. Some screenshot tests are affected, but there are no visible regressions. https://null.com/games/chainstaff works a lof faster with this change.
This commit is contained in:
parent
a4b289ebac
commit
c5afe70f77
Notes:
github-actions[bot]
2024-07-24 09:13:52 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: c5afe70f77
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/786
13 changed files with 74 additions and 0 deletions
|
@ -141,6 +141,11 @@ void ImageStyleValue::paint(PaintContext& context, DevicePixelRect const& dest_r
|
|||
}
|
||||
}
|
||||
|
||||
Gfx::ImmutableBitmap const* ImageStyleValue::current_frame_bitmap(DevicePixelRect const& dest_rect) const
|
||||
{
|
||||
return bitmap(m_current_frame_index, dest_rect.size().to_type<int>());
|
||||
}
|
||||
|
||||
JS::GCPtr<HTML::DecodedImageData> ImageStyleValue::image_data() const
|
||||
{
|
||||
if (!m_image_request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue