diff --git a/Libraries/LibGfx/Bitmap.cpp b/Libraries/LibGfx/Bitmap.cpp index 783bb46299..6d6a35dd7e 100644 --- a/Libraries/LibGfx/Bitmap.cpp +++ b/Libraries/LibGfx/Bitmap.cpp @@ -71,14 +71,6 @@ RefPtr Bitmap::load_from_file(const StringView& path) return load_png(path); } -RefPtr Bitmap::load_from_file(BitmapFormat format, const StringView& path, const Size& size) -{ - MappedFile mapped_file(path); - if (!mapped_file.is_valid()) - return nullptr; - return adopt(*new Bitmap(format, size, move(mapped_file))); -} - Bitmap::Bitmap(BitmapFormat format, const Size& size, size_t pitch, RGBA32* data) : m_size(size) , m_data(data) @@ -89,16 +81,6 @@ Bitmap::Bitmap(BitmapFormat format, const Size& size, size_t pitch, RGBA32* data m_palette = new RGBA32[256]; } -Bitmap::Bitmap(BitmapFormat format, const Size& size, MappedFile&& mapped_file) - : m_size(size) - , m_data((RGBA32*)mapped_file.data()) - , m_pitch(round_up_to_power_of_two(size.width() * sizeof(RGBA32), 16)) - , m_format(format) - , m_mapped_file(move(mapped_file)) -{ - ASSERT(format != BitmapFormat::Indexed8); -} - NonnullRefPtr Bitmap::create_with_shared_buffer(BitmapFormat format, NonnullRefPtr&& shared_buffer, const Size& size) { return adopt(*new Bitmap(format, move(shared_buffer), size)); diff --git a/Libraries/LibGfx/Bitmap.h b/Libraries/LibGfx/Bitmap.h index 8d719b93b2..fba0b6e719 100644 --- a/Libraries/LibGfx/Bitmap.h +++ b/Libraries/LibGfx/Bitmap.h @@ -27,7 +27,6 @@ #pragma once #include -#include #include #include #include @@ -48,7 +47,6 @@ public: static NonnullRefPtr create_purgeable(BitmapFormat, const Size&); static NonnullRefPtr create_wrapper(BitmapFormat, const Size&, size_t pitch, RGBA32*); static RefPtr load_from_file(const StringView& path); - static RefPtr load_from_file(BitmapFormat, const StringView& path, const Size&); static NonnullRefPtr create_with_shared_buffer(BitmapFormat, NonnullRefPtr&&, const Size&); NonnullRefPtr to_shareable_bitmap() const; @@ -138,7 +136,6 @@ private: Yes }; Bitmap(BitmapFormat, const Size&, Purgeable); Bitmap(BitmapFormat, const Size&, size_t pitch, RGBA32*); - Bitmap(BitmapFormat, const Size&, MappedFile&&); Bitmap(BitmapFormat, NonnullRefPtr&&, const Size&); Size m_size; @@ -149,7 +146,6 @@ private: bool m_needs_munmap { false }; bool m_purgeable { false }; bool m_volatile { false }; - MappedFile m_mapped_file; RefPtr m_shared_buffer; }; diff --git a/Libraries/LibGfx/GIFLoader.cpp b/Libraries/LibGfx/GIFLoader.cpp index 84da808835..c958694e92 100644 --- a/Libraries/LibGfx/GIFLoader.cpp +++ b/Libraries/LibGfx/GIFLoader.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include