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

LibGfx: Remove load_FORMAT() image codec wrappers

We had a bunch of old unused wrapper functions for each image codec that
would load a supported image with a given path. Nobody actually used
them, so let's just get rid of load_png(), load_gif(), etc.
This commit is contained in:
Andreas Kling 2021-11-11 11:32:22 +01:00
parent 09780ba7a9
commit 10add3f4c2
20 changed files with 2 additions and 105 deletions

View file

@ -10,8 +10,6 @@
#include <AK/Array.h>
#include <AK/Debug.h>
#include <AK/Endian.h>
#include <AK/LexicalPath.h>
#include <AK/MappedFile.h>
#include <AK/ScopeGuard.h>
#include <AK/String.h>
#include <AK/StringBuilder.h>
@ -272,13 +270,4 @@ static RefPtr<Gfx::Bitmap> load_from_memory(u8 const* data, size_t length, Strin
return bitmap;
}
template<typename TContext>
static RefPtr<Gfx::Bitmap> load(StringView path)
{
auto file_or_error = MappedFile::map(path);
if (file_or_error.is_error())
return nullptr;
return load_from_memory<TContext>((u8 const*)file_or_error.value()->data(), file_or_error.value()->size(), LexicalPath::canonicalized_path(path));
}
}