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

LibGfx/TGA: Simplify the code by converting it to use AK::Stream

The conversion to AK::Stream makes everything much more straightforward
and understandable now, because we remove the custom reader we had.
Because AK::Stream is more tested, it means that the code should be now
more robust against bugs as well.
This commit is contained in:
Liav A 2023-07-22 00:55:50 +03:00 committed by Sam Atkins
parent 18b7ddd0b5
commit dc612231f5
2 changed files with 79 additions and 171 deletions

View file

@ -18,7 +18,6 @@ public:
static ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> create(ReadonlyBytes);
virtual ~TGAImageDecoderPlugin() override;
TGAImageDecoderPlugin(u8 const*, size_t);
virtual IntSize size() override;
@ -26,8 +25,10 @@ public:
virtual ErrorOr<Optional<ReadonlyBytes>> icc_data() override;
private:
TGAImageDecoderPlugin(NonnullOwnPtr<TGALoadingContext>);
ErrorOr<void> decode_tga_header();
OwnPtr<TGALoadingContext> m_context;
NonnullOwnPtr<TGALoadingContext> m_context;
};
}