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

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.
This commit is contained in:
Andreas Kling 2021-07-27 01:29:50 +02:00
parent d01b4327fa
commit 751cb094ff
13 changed files with 35 additions and 49 deletions

View file

@ -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;