mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +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
|
@ -91,7 +91,11 @@ RefPtr<Gfx::Bitmap> Clipboard::bitmap() const
|
|||
if (!format.has_value() || format.value() == 0)
|
||||
return nullptr;
|
||||
|
||||
auto clipping_bitmap = Gfx::Bitmap::try_create_wrapper((Gfx::BitmapFormat)format.value(), { (int)width.value(), (int)height.value() }, scale.value(), pitch.value(), clipping.data.data());
|
||||
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 bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, { (int)width.value(), (int)height.value() }, scale.value());
|
||||
|
||||
for (int y = 0; y < clipping_bitmap->physical_height(); ++y) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue