1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

LibGfx: Support BMP favicons with less than 32 bpp

Adapt BMPImageDecoderPlugin to support BMP images included in ICOns.
ICOImageDecoderPlugin now uses BMPImageDecoderPlugin to decode all
BMP images instead of it's own ad-hoc decoder which only supported
32 bpp BMPs.
This commit is contained in:
Bruno Conde 2022-12-18 18:13:19 +00:00 committed by Andreas Kling
parent 91609f9327
commit 7e9019a9c3
5 changed files with 192 additions and 158 deletions

View file

@ -15,12 +15,13 @@ struct BMPLoadingContext;
class BMPImageDecoderPlugin final : public ImageDecoderPlugin {
public:
virtual ~BMPImageDecoderPlugin() override;
BMPImageDecoderPlugin(u8 const*, size_t);
BMPImageDecoderPlugin(u8 const*, size_t, bool is_included_in_ico = false);
virtual IntSize size() override;
virtual void set_volatile() override;
[[nodiscard]] virtual bool set_nonvolatile(bool& was_purged) override;
virtual bool sniff() override;
bool sniff_dib();
virtual bool is_animated() override;
virtual size_t loop_count() override;
virtual size_t frame_count() override;