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

LibGfx: Remove all load_FORMAT_from_memory() decoder wrappers

There are no more clients of these APIs, now that everyone has been made
to use ImageDecoderPlugin objects instead.
This commit is contained in:
Andreas Kling 2021-11-12 15:51:53 +01:00
parent 481e7b7971
commit 47edd6ae89
16 changed files with 2 additions and 146 deletions

View file

@ -165,17 +165,8 @@ private:
size_t m_size_remaining { 0 };
};
static RefPtr<Gfx::Bitmap> load_png_impl(const u8*, size_t);
static bool process_chunk(Streamer&, PNGLoadingContext& context);
RefPtr<Gfx::Bitmap> load_png_from_memory(u8 const* data, size_t length, String const& mmap_name)
{
auto bitmap = load_png_impl(data, length);
if (bitmap)
bitmap->set_mmap_name(String::formatted("Gfx::Bitmap [{}] - Decoded PNG: {}", bitmap->size(), mmap_name));
return bitmap;
}
ALWAYS_INLINE static u8 paeth_predictor(int a, int b, int c)
{
int p = a + b - c;
@ -775,21 +766,6 @@ static bool decode_png_bitmap(PNGLoadingContext& context)
return true;
}
static RefPtr<Gfx::Bitmap> load_png_impl(const u8* data, size_t data_size)
{
PNGLoadingContext context;
context.data = data;
context.data_size = data_size;
if (!decode_png_chunks(context))
return nullptr;
if (!decode_png_bitmap(context))
return nullptr;
return context.bitmap;
}
static bool is_valid_compression_method(u8 compression_method)
{
return compression_method == 0;