diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-27 01:29:50 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-27 01:29:50 +0200 |
commit | 751cb094ff5f2752cca3629f951bd9e99efc77f4 (patch) | |
tree | d80f67f92e34ed560fe82228817e5d1f15c7006c /Userland/Libraries/LibWeb/Loader | |
parent | d01b4327fabeabe77a3e57ab5d8a7dfb82eb3c52 (diff) | |
download | serenity-751cb094ff5f2752cca3629f951bd9e99efc77f4.zip |
LibGfx: Remove Gfx::ImageDecoder::bitmap() in favor of frame(index)
To transparently support multi-frame images, all decoder plugins have
already been updated to return their only bitmap for frame(0).
This patch completes the remaining cleanup work by removing the
ImageDecoder::bitmap() API and having all clients call frame() instead.
Diffstat (limited to 'Userland/Libraries/LibWeb/Loader')
-rw-r--r-- | Userland/Libraries/LibWeb/Loader/FrameLoader.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 1fc5755223..2a65d0f463 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -71,7 +71,8 @@ static bool build_image_document(DOM::Document& document, const ByteBuffer& data auto image_decoder = Gfx::ImageDecoder::try_create(data.bytes()); if (!image_decoder) return false; - auto bitmap = image_decoder->bitmap(); + auto frame = image_decoder->frame(0); + auto bitmap = frame.image; if (!bitmap) return false; @@ -171,7 +172,8 @@ bool FrameLoader::load(const LoadRequest& request, Type type) dbgln("No image decoder plugin for favicon {}", favicon_url); return; } - auto bitmap = decoder->bitmap(); + auto frame = decoder->frame(0); + auto bitmap = frame.image; if (!bitmap) { dbgln("Could not decode favicon {}", favicon_url); return; |