diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp index 243503515d..6bd26f3d5f 100644 --- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp +++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp @@ -44,14 +44,6 @@ static StringView bpp_for_format_resilient(DeprecatedString format) unsigned format_uint = format.to_uint().value_or(static_cast(Gfx::BitmapFormat::Invalid)); // Cannot use Gfx::Bitmap::bpp_for_format here, as we have to accept invalid enum values. switch (static_cast(format_uint)) { - case Gfx::BitmapFormat::Indexed1: - return "1"sv; - case Gfx::BitmapFormat::Indexed2: - return "2"sv; - case Gfx::BitmapFormat::Indexed4: - return "4"sv; - case Gfx::BitmapFormat::Indexed8: - return "8"sv; case Gfx::BitmapFormat::BGRx8888: case Gfx::BitmapFormat::BGRA8888: return "32"sv; diff --git a/Userland/Libraries/LibGUI/Clipboard.cpp b/Userland/Libraries/LibGUI/Clipboard.cpp index 73fd566e7e..4c4792e03f 100644 --- a/Userland/Libraries/LibGUI/Clipboard.cpp +++ b/Userland/Libraries/LibGUI/Clipboard.cpp @@ -102,10 +102,6 @@ RefPtr Clipboard::DataAndType::as_bitmap() const if (!Gfx::is_valid_bitmap_format(format.value())) return nullptr; auto bitmap_format = (Gfx::BitmapFormat)format.value(); - // We cannot handle indexed bitmaps, as the palette would be lost. - // Thankfully, everything that copies bitmaps also transforms them to RGB beforehand. - if (Gfx::determine_storage_format(bitmap_format) == Gfx::StorageFormat::Indexed8) - return nullptr; // We won't actually write to the clipping_bitmap, so casting away the const is okay. auto clipping_data = const_cast(data.data()); diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 732958c9a2..450bc49988 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -1025,7 +1025,7 @@ ErrorOr> Window::create_backing_store(Gfx::Int auto buffer = TRY(Core::AnonymousBuffer::create_with_size(round_up_to_power_of_two(size_in_bytes, PAGE_SIZE))); // FIXME: Plumb scale factor here eventually. - auto bitmap = TRY(Gfx::Bitmap::create_with_anonymous_buffer(format, buffer, size, 1, {})); + auto bitmap = TRY(Gfx::Bitmap::create_with_anonymous_buffer(format, buffer, size, 1)); return make(bitmap); } diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp index c29c3ac476..d76dead824 100644 --- a/Userland/Libraries/LibGfx/Bitmap.cpp +++ b/Userland/Libraries/LibGfx/Bitmap.cpp @@ -39,9 +39,6 @@ size_t Bitmap::minimum_pitch(size_t physical_width, BitmapFormat format) { size_t element_size; switch (determine_storage_format(format)) { - case StorageFormat::Indexed8: - element_size = 1; - break; case StorageFormat::BGRx8888: case StorageFormat::BGRA8888: case StorageFormat::RGBA8888: @@ -81,7 +78,7 @@ ErrorOr> Bitmap::create_shareable(BitmapFormat format, Int auto const data_size = size_in_bytes(pitch, size.height() * scale_factor); auto buffer = TRY(Core::AnonymousBuffer::create_with_size(round_up_to_power_of_two(data_size, PAGE_SIZE))); - auto bitmap = TRY(Bitmap::create_with_anonymous_buffer(format, buffer, size, scale_factor, {})); + auto bitmap = TRY(Bitmap::create_with_anonymous_buffer(format, buffer, size, scale_factor)); return bitmap; } @@ -96,7 +93,6 @@ Bitmap::Bitmap(BitmapFormat format, IntSize size, int scale_factor, BackingStore VERIFY(!size_would_overflow(format, size, scale_factor)); VERIFY(m_data); VERIFY(backing_store.size_in_bytes == size_in_bytes()); - allocate_palette_from_format(format, {}); m_needs_munmap = true; } @@ -170,8 +166,6 @@ Bitmap::Bitmap(BitmapFormat format, IntSize size, int scale_factor, size_t pitch VERIFY(pitch >= minimum_pitch(size.width() * scale_factor, format)); VERIFY(!size_would_overflow(format, size, scale_factor)); // FIXME: assert that `data` is actually long enough! - - allocate_palette_from_format(format, {}); } static bool check_size(IntSize size, int scale_factor, BitmapFormat format, unsigned actual_size) @@ -194,12 +188,12 @@ static bool check_size(IntSize size, int scale_factor, BitmapFormat format, unsi return true; } -ErrorOr> Bitmap::create_with_anonymous_buffer(BitmapFormat format, Core::AnonymousBuffer buffer, IntSize size, int scale_factor, Vector const& palette) +ErrorOr> Bitmap::create_with_anonymous_buffer(BitmapFormat format, Core::AnonymousBuffer buffer, IntSize size, int scale_factor) { if (size_would_overflow(format, size, scale_factor)) return Error::from_string_literal("Gfx::Bitmap::create_with_anonymous_buffer size overflow"); - return adopt_nonnull_ref_or_enomem(new (nothrow) Bitmap(format, move(buffer), size, scale_factor, palette)); + return adopt_nonnull_ref_or_enomem(new (nothrow) Bitmap(format, move(buffer), size, scale_factor)); } ErrorOr> Bitmap::create_from_serialized_byte_buffer(ByteBuffer&& buffer) @@ -213,8 +207,6 @@ ErrorOr> Bitmap::create_from_serialized_byte_buffer(ByteBu /// - height /// - scale_factor /// - format -/// - palette count -/// - palette data (= palette count * BGRA8888) /// - image data (= actual size * u8) ErrorOr> Bitmap::create_from_serialized_bytes(ReadonlyBytes bytes) { @@ -225,20 +217,13 @@ ErrorOr> Bitmap::create_from_serialized_bytes(ReadonlyByte auto height = TRY(stream.read_value()); auto scale_factor = TRY(stream.read_value()); auto format = TRY(stream.read_value()); - auto palette_size = TRY(stream.read_value()); - if (format > BitmapFormat::BGRA8888 || format < BitmapFormat::Indexed1) + if (format > BitmapFormat::LastValid || format < BitmapFormat::FirstValid) return Error::from_string_literal("Gfx::Bitmap::create_from_serialized_byte_buffer: decode failed"); if (!check_size({ width, height }, scale_factor, format, actual_size)) return Error::from_string_literal("Gfx::Bitmap::create_from_serialized_byte_buffer: decode failed"); - Vector palette; - palette.ensure_capacity(palette_size); - for (size_t i = 0; i < palette_size; ++i) { - palette[i] = TRY(stream.read_value()); - } - if (TRY(stream.size()) - TRY(stream.tell()) < actual_size) return Error::from_string_literal("Gfx::Bitmap::create_from_serialized_byte_buffer: decode failed"); @@ -246,30 +231,20 @@ ErrorOr> Bitmap::create_from_serialized_bytes(ReadonlyByte auto bitmap = TRY(Bitmap::create(format, { width, height }, scale_factor)); - bitmap->m_palette = new ARGB32[palette_size]; - memcpy(bitmap->m_palette, palette.data(), palette_size * sizeof(ARGB32)); - data.copy_to({ bitmap->scanline(0), bitmap->size_in_bytes() }); return bitmap; } ErrorOr Bitmap::serialize_to_byte_buffer() const { - auto buffer = TRY(ByteBuffer::create_uninitialized(sizeof(size_t) + 4 * sizeof(unsigned) + sizeof(BitmapFormat) + sizeof(ARGB32) * palette_size(m_format) + size_in_bytes())); + auto buffer = TRY(ByteBuffer::create_uninitialized(sizeof(size_t) + 4 * sizeof(unsigned) + sizeof(BitmapFormat) + size_in_bytes())); FixedMemoryStream stream { buffer.span() }; - auto palette = palette_to_vector(); - TRY(stream.write_value(size_in_bytes())); TRY(stream.write_value(size().width())); TRY(stream.write_value(size().height())); TRY(stream.write_value(scale())); TRY(stream.write_value(m_format)); - TRY(stream.write_value(palette.size())); - - for (auto& p : palette) { - TRY(stream.write_value(p)); - } auto size = size_in_bytes(); TRY(stream.write_until_depleted({ scanline(0), size })); @@ -279,7 +254,7 @@ ErrorOr Bitmap::serialize_to_byte_buffer() const return buffer; } -Bitmap::Bitmap(BitmapFormat format, Core::AnonymousBuffer buffer, IntSize size, int scale_factor, Vector const& palette) +Bitmap::Bitmap(BitmapFormat format, Core::AnonymousBuffer buffer, IntSize size, int scale_factor) : m_size(size) , m_scale(scale_factor) , m_data(buffer.data()) @@ -287,11 +262,7 @@ Bitmap::Bitmap(BitmapFormat format, Core::AnonymousBuffer buffer, IntSize size, , m_format(format) , m_buffer(move(buffer)) { - VERIFY(!is_indexed() || !palette.is_empty()); VERIFY(!size_would_overflow(format, size, scale_factor)); - - if (is_indexed(m_format)) - allocate_palette_from_format(m_format, palette); } ErrorOr> Bitmap::clone() const @@ -545,7 +516,7 @@ ErrorOr> Bitmap::to_bitmap_backed_by_anonymous_buffer() co return NonnullRefPtr { const_cast(*this) }; } auto buffer = TRY(Core::AnonymousBuffer::create_with_size(round_up_to_power_of_two(size_in_bytes(), PAGE_SIZE))); - auto bitmap = TRY(Bitmap::create_with_anonymous_buffer(m_format, move(buffer), size(), scale(), palette_to_vector())); + auto bitmap = TRY(Bitmap::create_with_anonymous_buffer(m_format, move(buffer), size(), scale())); memcpy(bitmap->scanline(0), scanline(0), size_in_bytes()); return bitmap; } @@ -567,7 +538,6 @@ Bitmap::~Bitmap() VERIFY(rc == 0); } m_data = nullptr; - delete[] m_palette; } void Bitmap::strip_alpha_channel() @@ -588,7 +558,6 @@ void Bitmap::set_mmap_name([[maybe_unused]] DeprecatedString const& name) void Bitmap::fill(Color color) { - VERIFY(!is_indexed(m_format)); for (int y = 0; y < physical_height(); ++y) { auto* scanline = this->scanline(y); fast_u32_fill(scanline, color.value(), physical_width()); @@ -660,28 +629,6 @@ ErrorOr Bitmap::allocate_backing_store(BitmapFormat format, IntSiz return BackingStore { data, pitch, data_size_in_bytes }; } -void Bitmap::allocate_palette_from_format(BitmapFormat format, Vector const& source_palette) -{ - size_t size = palette_size(format); - if (size == 0) - return; - m_palette = new ARGB32[size]; - if (!source_palette.is_empty()) { - VERIFY(source_palette.size() == size); - memcpy(m_palette, source_palette.data(), size * sizeof(ARGB32)); - } -} - -Vector Bitmap::palette_to_vector() const -{ - Vector vector; - auto size = palette_size(m_format); - vector.ensure_capacity(size); - for (size_t i = 0; i < size; ++i) - vector.unchecked_append(palette_color(i).value()); - return vector; -} - bool Bitmap::visually_equals(Bitmap const& other) const { auto own_width = width(); diff --git a/Userland/Libraries/LibGfx/Bitmap.h b/Userland/Libraries/LibGfx/Bitmap.h index 339399527d..a2ef9a508f 100644 --- a/Userland/Libraries/LibGfx/Bitmap.h +++ b/Userland/Libraries/LibGfx/Bitmap.h @@ -38,23 +38,18 @@ namespace Gfx { enum class BitmapFormat { Invalid, - Indexed1, - Indexed2, - Indexed4, - Indexed8, BGRx8888, BGRA8888, RGBA8888, + + FirstValid = BGRx8888, + LastValid = RGBA8888, }; inline bool is_valid_bitmap_format(unsigned format) { switch (format) { case (unsigned)BitmapFormat::Invalid: - case (unsigned)BitmapFormat::Indexed1: - case (unsigned)BitmapFormat::Indexed2: - case (unsigned)BitmapFormat::Indexed4: - case (unsigned)BitmapFormat::Indexed8: case (unsigned)BitmapFormat::BGRx8888: case (unsigned)BitmapFormat::BGRA8888: case (unsigned)BitmapFormat::RGBA8888: @@ -64,7 +59,6 @@ inline bool is_valid_bitmap_format(unsigned format) } enum class StorageFormat { - Indexed8, BGRx8888, BGRA8888, RGBA8888, @@ -79,11 +73,6 @@ inline StorageFormat determine_storage_format(BitmapFormat format) return StorageFormat::BGRA8888; case BitmapFormat::RGBA8888: return StorageFormat::RGBA8888; - case BitmapFormat::Indexed1: - case BitmapFormat::Indexed2: - case BitmapFormat::Indexed4: - case BitmapFormat::Indexed8: - return StorageFormat::Indexed8; default: VERIFY_NOT_REACHED(); } @@ -104,7 +93,7 @@ public: [[nodiscard]] static ErrorOr> load_from_file(StringView path, int scale_factor = 1, Optional ideal_size = {}); [[nodiscard]] static ErrorOr> load_from_file(NonnullOwnPtr, StringView path, Optional ideal_size = {}); [[nodiscard]] static ErrorOr> load_from_bytes(ReadonlyBytes, Optional ideal_size = {}, Optional mine_type = {}); - [[nodiscard]] static ErrorOr> create_with_anonymous_buffer(BitmapFormat, Core::AnonymousBuffer, IntSize, int intrinsic_scale, Vector const& palette); + [[nodiscard]] static ErrorOr> create_with_anonymous_buffer(BitmapFormat, Core::AnonymousBuffer, IntSize, int intrinsic_scale); static ErrorOr> create_from_serialized_bytes(ReadonlyBytes); static ErrorOr> create_from_serialized_byte_buffer(ByteBuffer&&); @@ -162,46 +151,9 @@ public: [[nodiscard]] int physical_height() const { return physical_size().height(); } [[nodiscard]] size_t pitch() const { return m_pitch; } - [[nodiscard]] ALWAYS_INLINE bool is_indexed() const - { - return is_indexed(m_format); - } - - [[nodiscard]] ALWAYS_INLINE static bool is_indexed(BitmapFormat format) - { - return format == BitmapFormat::Indexed8 || format == BitmapFormat::Indexed4 - || format == BitmapFormat::Indexed2 || format == BitmapFormat::Indexed1; - } - - [[nodiscard]] static size_t palette_size(BitmapFormat format) - { - switch (format) { - case BitmapFormat::Indexed1: - return 2; - case BitmapFormat::Indexed2: - return 4; - case BitmapFormat::Indexed4: - return 16; - case BitmapFormat::Indexed8: - return 256; - default: - return 0; - } - } - - [[nodiscard]] Vector palette_to_vector() const; - [[nodiscard]] static unsigned bpp_for_format(BitmapFormat format) { switch (format) { - case BitmapFormat::Indexed1: - return 1; - case BitmapFormat::Indexed2: - return 2; - case BitmapFormat::Indexed4: - return 4; - case BitmapFormat::Indexed8: - return 8; case BitmapFormat::BGRx8888: case BitmapFormat::BGRA8888: return 32; @@ -232,9 +184,6 @@ public: [[nodiscard]] static constexpr size_t size_in_bytes(size_t pitch, int physical_height) { return pitch * physical_height; } [[nodiscard]] size_t size_in_bytes() const { return size_in_bytes(m_pitch, physical_height()); } - [[nodiscard]] Color palette_color(u8 index) const { return Color::from_argb(m_palette[index]); } - void set_palette_color(u8 index, Color color) { m_palette[index] = color.value(); } - template [[nodiscard]] Color get_pixel(int physical_x, int physical_y) const; [[nodiscard]] Color get_pixel(int physical_x, int physical_y) const; @@ -270,16 +219,13 @@ public: private: Bitmap(BitmapFormat, IntSize, int, BackingStore const&); Bitmap(BitmapFormat, IntSize, int, size_t pitch, void*); - Bitmap(BitmapFormat, Core::AnonymousBuffer, IntSize, int, Vector const& palette); + Bitmap(BitmapFormat, Core::AnonymousBuffer, IntSize, int); static ErrorOr allocate_backing_store(BitmapFormat format, IntSize size, int scale_factor); - void allocate_palette_from_format(BitmapFormat, Vector const& source_palette); - IntSize m_size; int m_scale; void* m_data { nullptr }; - ARGB32* m_palette { nullptr }; size_t m_pitch { 0 }; BitmapFormat m_format { BitmapFormat::Invalid }; bool m_needs_munmap { false }; @@ -337,14 +283,6 @@ ALWAYS_INLINE Color Bitmap::get_pixel(int x, int y) con return Color::from_argb(scanline(y)[x]); } -template<> -ALWAYS_INLINE Color Bitmap::get_pixel(int x, int y) const -{ - VERIFY(x >= 0); - VERIFY(x < physical_width()); - return Color::from_rgb(m_palette[scanline_u8(y)[x]]); -} - ALWAYS_INLINE Color Bitmap::get_pixel(int x, int y) const { switch (determine_storage_format(m_format)) { @@ -352,8 +290,6 @@ ALWAYS_INLINE Color Bitmap::get_pixel(int x, int y) const return get_pixel(x, y); case StorageFormat::BGRA8888: return get_pixel(x, y); - case StorageFormat::Indexed8: - return get_pixel(x, y); default: VERIFY_NOT_REACHED(); } @@ -398,8 +334,6 @@ ALWAYS_INLINE void Bitmap::set_pixel(int x, int y, Color color) case StorageFormat::RGBA8888: set_pixel(x, y, color); break; - case StorageFormat::Indexed8: - VERIFY_NOT_REACHED(); default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp b/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp index ee1059841e..c64b62082c 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/WebPLoaderLossless.cpp @@ -888,8 +888,6 @@ ErrorOr> ColorIndexingTransform::read(Litt ErrorOr> ColorIndexingTransform::transform(NonnullRefPtr bitmap) { - // FIXME: If this is the last transform, consider returning an Indexed8 bitmap here? - if (pixels_per_pixel() == 1) { for (ARGB32& pixel : *bitmap) { // "The inverse transform for the image is simply replacing the pixel values (which are indices to the color table) diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index d9806532af..ee75e909ec 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -63,14 +63,6 @@ ALWAYS_INLINE static Color color_for_format(BitmapFormat format, ARGB32 value) template ALWAYS_INLINE Color get_pixel(Gfx::Bitmap const& bitmap, int x, int y) { - if constexpr (format == BitmapFormat::Indexed8) - return bitmap.palette_color(bitmap.scanline_u8(y)[x]); - if constexpr (format == BitmapFormat::Indexed4) - return bitmap.palette_color(bitmap.scanline_u8(y)[x]); - if constexpr (format == BitmapFormat::Indexed2) - return bitmap.palette_color(bitmap.scanline_u8(y)[x]); - if constexpr (format == BitmapFormat::Indexed1) - return bitmap.palette_color(bitmap.scanline_u8(y)[x]); if constexpr (format == BitmapFormat::BGRx8888) return Color::from_rgb(bitmap.scanline(y)[x]); if constexpr (format == BitmapFormat::BGRA8888) @@ -1126,18 +1118,6 @@ void Painter::blit(IntPoint position, Gfx::Bitmap const& source, IntRect const& return; } - if (Bitmap::is_indexed(source.format())) { - u8 const* src = source.scanline_u8(src_rect.top() + first_row) + src_rect.left() + first_column; - size_t const src_skip = source.pitch(); - for (int row = first_row; row <= last_row; ++row) { - for (int i = 0; i < clipped_rect.width(); ++i) - dst[i] = source.palette_color(src[i]).value(); - dst += dst_skip; - src += src_skip; - } - return; - } - VERIFY_NOT_REACHED(); } @@ -1373,18 +1353,6 @@ void Painter::draw_scaled_bitmap(IntRect const& a_dst_rect, Gfx::Bitmap const& s case BitmapFormat::BGRA8888: do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); break; - case BitmapFormat::Indexed8: - do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); - break; - case BitmapFormat::Indexed4: - do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); - break; - case BitmapFormat::Indexed2: - do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); - break; - case BitmapFormat::Indexed1: - do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); - break; default: do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); break; @@ -1394,9 +1362,6 @@ void Painter::draw_scaled_bitmap(IntRect const& a_dst_rect, Gfx::Bitmap const& s case BitmapFormat::BGRx8888: do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); break; - case BitmapFormat::Indexed8: - do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); - break; default: do_draw_scaled_bitmap(*m_target, dst_rect, clipped_rect, source, src_rect, Gfx::get_pixel, opacity, scaling_mode); break; diff --git a/Userland/Libraries/LibGfx/ShareableBitmap.cpp b/Userland/Libraries/LibGfx/ShareableBitmap.cpp index e3f94469fe..26f87a2195 100644 --- a/Userland/Libraries/LibGfx/ShareableBitmap.cpp +++ b/Userland/Libraries/LibGfx/ShareableBitmap.cpp @@ -34,11 +34,6 @@ ErrorOr encode(Encoder& encoder, Gfx::ShareableBitmap const& shareable_bit TRY(encoder.encode(bitmap.size())); TRY(encoder.encode(static_cast(bitmap.scale()))); TRY(encoder.encode(static_cast(bitmap.format()))); - if (bitmap.is_indexed()) { - auto palette = bitmap.palette_to_vector(); - TRY(encoder.encode(palette)); - } - return {}; } @@ -57,12 +52,8 @@ ErrorOr decode(Decoder& decoder) auto bitmap_format = static_cast(raw_bitmap_format); - Vector palette; - if (Gfx::Bitmap::is_indexed(bitmap_format)) - palette = TRY(decoder.decode()); - auto buffer = TRY(Core::AnonymousBuffer::create_from_anon_fd(anon_file.take_fd(), Gfx::Bitmap::size_in_bytes(Gfx::Bitmap::minimum_pitch(size.width() * scale, bitmap_format), size.height() * scale))); - auto bitmap = TRY(Gfx::Bitmap::create_with_anonymous_buffer(bitmap_format, move(buffer), size, scale, palette)); + auto bitmap = TRY(Gfx::Bitmap::create_with_anonymous_buffer(bitmap_format, move(buffer), size, scale)); return Gfx::ShareableBitmap { move(bitmap), Gfx::ShareableBitmap::ConstructWithKnownGoodBitmap }; } diff --git a/Userland/Services/WindowServer/ConnectionFromClient.cpp b/Userland/Services/WindowServer/ConnectionFromClient.cpp index 46cc91860a..30179d57eb 100644 --- a/Userland/Services/WindowServer/ConnectionFromClient.cpp +++ b/Userland/Services/WindowServer/ConnectionFromClient.cpp @@ -778,8 +778,7 @@ void ConnectionFromClient::set_window_backing_store(i32 window_id, [[maybe_unuse has_alpha_channel ? Gfx::BitmapFormat::BGRA8888 : Gfx::BitmapFormat::BGRx8888, buffer_or_error.release_value(), size, - 1, - {}); + 1); if (backing_store_or_error.is_error()) { did_misbehave(""); } diff --git a/Userland/Utilities/image.cpp b/Userland/Utilities/image.cpp index 7fc97e2eb6..492bb80835 100644 --- a/Userland/Utilities/image.cpp +++ b/Userland/Utilities/image.cpp @@ -71,11 +71,7 @@ ErrorOr serenity_main(Main::Arguments arguments) if (move_alpha_to_rgb) { switch (frame->format()) { case Gfx::BitmapFormat::Invalid: - case Gfx::BitmapFormat::Indexed1: - case Gfx::BitmapFormat::Indexed2: - case Gfx::BitmapFormat::Indexed4: - case Gfx::BitmapFormat::Indexed8: - warnln("Can't --strip-alpha with indexed or invalid bitmaps"); + warnln("Can't --strip-alpha with invalid bitmaps"); return 1; case Gfx::BitmapFormat::RGBA8888: // No image decoder currently produces bitmaps with this format. @@ -96,11 +92,7 @@ ErrorOr serenity_main(Main::Arguments arguments) if (strip_alpha) { switch (frame->format()) { case Gfx::BitmapFormat::Invalid: - case Gfx::BitmapFormat::Indexed1: - case Gfx::BitmapFormat::Indexed2: - case Gfx::BitmapFormat::Indexed4: - case Gfx::BitmapFormat::Indexed8: - warnln("Can't --strip-alpha with indexed or invalid bitmaps"); + warnln("Can't --strip-alpha with invalid bitmaps"); return 1; case Gfx::BitmapFormat::RGBA8888: // No image decoder currently produces bitmaps with this format.