mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07: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
|
@ -39,7 +39,10 @@ RefPtr<Gfx::Bitmap> ClipboardServerConnection::get_bitmap()
|
|||
return nullptr;
|
||||
|
||||
auto data = clipping.data().data<void>();
|
||||
auto clipping_bitmap = Gfx::Bitmap::try_create_wrapper((Gfx::BitmapFormat)format.value(), { (int)width.value(), (int)height.value() }, scale.value(), pitch.value(), const_cast<void*>(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(), const_cast<void*>(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