mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +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:
@@ -52,14 +52,7 @@ Messages::ImageDecoderServer::DecodeImageResponse ClientConnection::decode_image
|
||||
Vector<Gfx::ShareableBitmap> bitmaps;
|
||||
Vector<u32> durations;
|
||||
for (size_t i = 0; i < decoder->frame_count(); ++i) {
|
||||
// FIXME: All image decoder plugins should be rewritten to return frame() instead of bitmap().
|
||||
// Non-animated images can simply return 1 frame.
|
||||
Gfx::ImageFrameDescriptor frame;
|
||||
if (decoder->is_animated()) {
|
||||
frame = decoder->frame(i);
|
||||
} else {
|
||||
frame.image = decoder->bitmap();
|
||||
}
|
||||
auto frame = decoder->frame(i);
|
||||
if (frame.image)
|
||||
bitmaps.append(frame.image->to_shareable_bitmap());
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user