1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

LibGfx: Use ErrorOr<T> for Bitmap::try_create()

Another one that was used in a fajillion places.
This commit is contained in:
Andreas Kling 2021-11-06 19:30:59 +01:00
parent 235f39e449
commit 0de33b3d6c
43 changed files with 157 additions and 141 deletions

View file

@ -64,7 +64,7 @@ static RefPtr<Gfx::Bitmap> s_background_inverted;
Card::Card(Type type, uint8_t value)
: m_rect(Gfx::IntRect({}, { width, height }))
, m_front(*Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { width, height }))
, m_front(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { width, height }).release_value_but_fixme_should_propagate_errors())
, m_type(type)
, m_value(value)
{
@ -72,7 +72,7 @@ Card::Card(Type type, uint8_t value)
Gfx::IntRect paint_rect({ 0, 0 }, { width, height });
if (s_background.is_null()) {
s_background = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { width, height });
s_background = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { width, height }).release_value_but_fixme_should_propagate_errors();
Gfx::Painter bg_painter(*s_background);
auto image = Gfx::Bitmap::try_load_from_file("/res/icons/cards/buggie-deck.png").release_value_but_fixme_should_propagate_errors();