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
commit 0de33b3d6c
Notes: sideshowbarker 2024-07-18 01:24:23 +09:00
43 changed files with 157 additions and 141 deletions

View file

@ -903,8 +903,7 @@ void Window::set_icon(const Gfx::Bitmap* icon)
Gfx::IntSize icon_size = icon ? icon->size() : Gfx::IntSize(16, 16);
m_icon = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, icon_size);
VERIFY(m_icon);
m_icon = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, icon_size).release_value_but_fixme_should_propagate_errors();
if (icon) {
Painter painter(*m_icon);
painter.blit({ 0, 0 }, *icon, icon->rect());