1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:37:45 +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

@ -1185,7 +1185,7 @@ static bool decode_bmp_pixel_data(BMPLoadingContext& context)
const u32 width = abs(context.dib.core.width);
const u32 height = abs(context.dib.core.height);
context.bitmap = Bitmap::try_create_purgeable(format, { static_cast<int>(width), static_cast<int>(height) });
context.bitmap = Bitmap::try_create(format, { static_cast<int>(width), static_cast<int>(height) });
if (!context.bitmap) {
dbgln("BMP appears to have overly large dimensions");
return false;