mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
LibGfx: Use ErrorOr<T> for Bitmap::try_create_wrapper()
This commit is contained in:
parent
2116620db8
commit
83d1460ee8
7 changed files with 18 additions and 11 deletions
|
@ -49,7 +49,7 @@ Canvas::Canvas()
|
|||
// When drawing on a 1x backing store it'd draw m_bitmap_1x at its physical size, and it would have to scale down m_bitmap_2x to 0.5x its size.
|
||||
// But the system can't current scale down, and we want to draw the 2x bitmap at twice the size of the 1x bitmap in this particular application,
|
||||
// so make a 1x alias of the 2x bitmap to make LibGfx paint it without any scaling at paint time, mapping once pixel to one pixel.
|
||||
m_bitmap_2x_as_1x = Gfx::Bitmap::try_create_wrapper(Gfx::BitmapFormat::BGRx8888, m_bitmap_2x->physical_size(), 1, m_bitmap_2x->pitch(), m_bitmap_2x->scanline(0));
|
||||
m_bitmap_2x_as_1x = Gfx::Bitmap::try_create_wrapper(Gfx::BitmapFormat::BGRx8888, m_bitmap_2x->physical_size(), 1, m_bitmap_2x->pitch(), m_bitmap_2x->scanline(0)).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
Gfx::Painter painter_1x(*m_bitmap_1x);
|
||||
draw(painter_1x);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue