mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00: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
43 changed files with 157 additions and 141 deletions
|
@ -94,9 +94,12 @@ RefPtr<Gfx::Bitmap> Clipboard::bitmap() const
|
|||
auto clipping_bitmap_or_error = Gfx::Bitmap::try_create_wrapper((Gfx::BitmapFormat)format.value(), { (int)width.value(), (int)height.value() }, scale.value(), pitch.value(), clipping.data.data());
|
||||
if (clipping_bitmap_or_error.is_error())
|
||||
return nullptr;
|
||||
auto clipping_bitmap = clipping_bitmap_or_error.release_value();
|
||||
auto clipping_bitmap = clipping_bitmap_or_error.release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
auto bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { (int)width.value(), (int)height.value() }, scale.value());
|
||||
auto bitmap_or_error = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { (int)width.value(), (int)height.value() }, scale.value());
|
||||
if (bitmap_or_error.is_error())
|
||||
return nullptr;
|
||||
auto bitmap = bitmap_or_error.release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
for (int y = 0; y < clipping_bitmap->physical_height(); ++y) {
|
||||
for (int x = 0; x < clipping_bitmap->physical_width(); ++x) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue