LibGfx: Add a test for bitmap export

The verified pixel output in this test just reflects currently observed
behavior, I have not verified that all cases output the correct data wrt
what the spec expects.
This commit is contained in:
InvalidUsernameException 2025-11-23 13:07:43 +01:00 committed by Jelle Raaijmakers
parent a81e407c44
commit 1f8a42c367
Notes: github-actions[bot] 2025-11-28 17:34:12 +00:00
6 changed files with 294 additions and 16 deletions

View file

@ -31,6 +31,18 @@ struct BackingStore {
size_t size_in_bytes { 0 };
};
StringView bitmap_format_name(BitmapFormat format)
{
switch (format) {
#define ENUMERATE_BITMAP_FORMAT(format) \
case BitmapFormat::format: \
return #format##sv;
ENUMERATE_BITMAP_FORMATS(ENUMERATE_BITMAP_FORMAT)
#undef ENUMERATE_BITMAP_FORMAT
}
VERIFY_NOT_REACHED();
}
size_t Bitmap::minimum_pitch(size_t width, BitmapFormat format)
{
size_t element_size;