1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 12:08:14 +00:00

LibGfx: Remove "purgeable Gfx::Bitmap" as a separate concept

This was a really weird thing to begin with, purgeable bitmaps were
basically regular bitmaps without a physical memory reservation.

Since all the clients of this code ended up populating the bitmaps
with pixels immediately after allocating them anyway, there was no
need to avoid the reservation.

Instead, all Gfx::Bitmaps are now purgeable, in the sense that they
can be marked as volatile or non-volatile.

The only difference here is that allocation failure is surfaced when
we try to create the bitmap instead of during the handling of a
subsequent page fault.
This commit is contained in:
Andreas Kling 2021-07-24 18:31:59 +02:00
parent deec79b3c6
commit 24b5295b30
9 changed files with 17 additions and 44 deletions

View file

@ -246,7 +246,7 @@ static bool load_ico_bmp(ICOLoadingContext& context, ICOImageDescriptor& desc)
return false;
}
desc.bitmap = Bitmap::try_create_purgeable(BitmapFormat::BGRA8888, { desc.width, desc.height });
desc.bitmap = Bitmap::try_create(BitmapFormat::BGRA8888, { desc.width, desc.height });
if (!desc.bitmap)
return false;
Bitmap& bitmap = *desc.bitmap;