1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibGfx: Remove indexed palette formats from Bitmap and Painter

Nobody was actually using these formats anymore, and this simplifies
and shrinks the code. :^)
This commit is contained in:
Andreas Kling 2023-10-11 12:35:50 +02:00
parent bcbaad0b1d
commit a396bb0c0b
10 changed files with 17 additions and 203 deletions

View file

@ -102,10 +102,6 @@ RefPtr<Gfx::Bitmap> 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<u8*>(data.data());