LibGfx: Provide a default implementation for animation-related methods

Most image decoders that we have only support non-animated images,
providing a default implementation for them allows to remove quite some
code.
This commit is contained in:
Lucas CHOLLET 2023-07-17 13:29:12 -04:00 committed by Sam Atkins
commit 806808f406
Notes: sideshowbarker 2024-07-17 10:54:57 +09:00
14 changed files with 6 additions and 160 deletions

View file

@ -60,10 +60,6 @@ public:
virtual IntSize size() override;
virtual bool is_animated() override;
virtual size_t loop_count() override;
virtual size_t frame_count() override;
virtual size_t first_animated_frame_index() override;
virtual ErrorOr<ImageFrameDescriptor> frame(size_t index, Optional<IntSize> ideal_size = {}) override;
virtual ErrorOr<Optional<ReadonlyBytes>> icc_data() override;
@ -110,30 +106,6 @@ bool PortableImageDecoderPlugin<TContext>::sniff(ReadonlyBytes data)
return false;
}
template<typename TContext>
bool PortableImageDecoderPlugin<TContext>::is_animated()
{
return false;
}
template<typename TContext>
size_t PortableImageDecoderPlugin<TContext>::loop_count()
{
return 0;
}
template<typename TContext>
size_t PortableImageDecoderPlugin<TContext>::frame_count()
{
return 1;
}
template<typename TContext>
size_t PortableImageDecoderPlugin<TContext>::first_animated_frame_index()
{
return 0;
}
template<typename TContext>
ErrorOr<ImageFrameDescriptor> PortableImageDecoderPlugin<TContext>::frame(size_t index, Optional<IntSize>)
{