mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibCore+AK: Move MappedFile from AK to LibCore
MappedFile is strictly a userspace thing, so it doesn't belong in AK (which is supposed to be user/kernel agnostic.)
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 00:49:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/58fb3ebf660
@@ -8,10 +8,10 @@
|
||||
#include "Image.h"
|
||||
#include "Layer.h"
|
||||
#include <AK/JsonObject.h>
|
||||
#include <AK/MappedFile.h>
|
||||
#include <AK/Result.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/MappedFile.h>
|
||||
#include <LibImageDecoderClient/Client.h>
|
||||
|
||||
namespace PixelPaint {
|
||||
@@ -29,7 +29,7 @@ ErrorOr<void> ProjectLoader::try_load_from_fd_and_close(int fd, StringView path)
|
||||
if (json_or_error.is_error()) {
|
||||
m_is_raw_image = true;
|
||||
|
||||
auto mapped_file = TRY(MappedFile::map_from_fd_and_close(fd, path));
|
||||
auto mapped_file = TRY(Core::MappedFile::map_from_fd_and_close(fd, path));
|
||||
|
||||
// FIXME: Find a way to avoid the memory copy here.
|
||||
auto bitmap = TRY(Image::try_decode_bitmap(mapped_file->bytes()));
|
||||
|
||||
Reference in New Issue
Block a user