mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:37:35 +00:00
LibGfx: Move common loader functionality to load from memory functions
This will share functionality between the load from path and load from memory functions.
This commit is contained in:
parent
eb5320023a
commit
c966c32571
19 changed files with 54 additions and 70 deletions
|
@ -102,12 +102,9 @@ RefPtr<Gfx::Bitmap> load_pbm(const StringView& path)
|
|||
return load<PBMLoadingContext>(path);
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap> load_pbm_from_memory(const u8* data, size_t length)
|
||||
RefPtr<Gfx::Bitmap> load_pbm_from_memory(u8 const* data, size_t length, String const& mmap_name)
|
||||
{
|
||||
auto bitmap = load_impl<PBMLoadingContext>(data, length);
|
||||
if (bitmap)
|
||||
bitmap->set_mmap_name(String::formatted("Gfx::Bitmap [{}] - Decoded PBM: <memory>", bitmap->size()));
|
||||
return bitmap;
|
||||
return load_from_memory<PBMLoadingContext>(data, length, mmap_name);
|
||||
}
|
||||
|
||||
PBMImageDecoderPlugin::PBMImageDecoderPlugin(const u8* data, size_t size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue