mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
LibGfx: Use ErrorOr<T> for Bitmap::try_create()
Another one that was used in a fajillion places.
This commit is contained in:
parent
235f39e449
commit
0de33b3d6c
Notes:
sideshowbarker
2024-07-18 01:24:23 +09:00
Author: https://github.com/awesomekling
Commit: 0de33b3d6c
43 changed files with 157 additions and 141 deletions
|
@ -241,9 +241,10 @@ static bool load_ico_bmp(ICOLoadingContext& context, ICOImageDescriptor& desc)
|
|||
return false;
|
||||
}
|
||||
|
||||
desc.bitmap = Bitmap::try_create(BitmapFormat::BGRA8888, { desc.width, desc.height });
|
||||
if (!desc.bitmap)
|
||||
auto bitmap_or_error = Bitmap::try_create(BitmapFormat::BGRA8888, { desc.width, desc.height });
|
||||
if (bitmap_or_error.is_error())
|
||||
return false;
|
||||
desc.bitmap = bitmap_or_error.release_value_but_fixme_should_propagate_errors();
|
||||
Bitmap& bitmap = *desc.bitmap;
|
||||
const u8* image_base = context.data + desc.offset + sizeof(info);
|
||||
const BMP_ARGB* data_base = (const BMP_ARGB*)image_base;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue