1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:17:45 +00:00

LibWeb: Paint 1x1 backgrounds as color fill instead of tiling bitmap

This yields a huge speedup on pages that use this weird but
not-entirely-uncommon technique.
This commit is contained in:
Andreas Kling 2024-01-01 13:48:53 +01:00
parent e8f04be3ae
commit 6eeda29642
4 changed files with 47 additions and 14 deletions

View file

@ -37,6 +37,8 @@ public:
virtual bool is_paintable() const = 0;
virtual void paint(PaintContext& context, DevicePixelRect const& dest_rect, ImageRendering) const = 0;
virtual Optional<Gfx::Color> color_if_single_pixel_bitmap() const { return {}; }
};
// And now, some gradient related things. Maybe these should live somewhere else.