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:
Aliaksandr Kalenik 2024-07-23 15:36:28 +03:00 committed by Andreas Kling
commit c5afe70f77
Notes: github-actions[bot] 2024-07-24 09:13:52 +00:00
13 changed files with 74 additions and 0 deletions

View file

@ -48,6 +48,7 @@ public:
void paint(PaintContext& context, DevicePixelRect const& dest_rect, CSS::ImageRendering image_rendering, Vector<Gfx::Path> const& clip_paths = {}) const override;
virtual Optional<Gfx::Color> color_if_single_pixel_bitmap() const override;
Gfx::ImmutableBitmap const* current_frame_bitmap(DevicePixelRect const& dest_rect) const;
Function<void()> on_animate;