summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/Bitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGfx/Bitmap.cpp')
-rw-r--r--Userland/Libraries/LibGfx/Bitmap.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp
index eb08fc8880..ac198aed3f 100644
--- a/Userland/Libraries/LibGfx/Bitmap.cpp
+++ b/Userland/Libraries/LibGfx/Bitmap.cpp
@@ -372,11 +372,13 @@ ErrorOr<NonnullRefPtr<Gfx::Bitmap>> Bitmap::rotated(Gfx::RotationDirection rotat
return new_bitmap.release_nonnull();
}
-RefPtr<Gfx::Bitmap> Bitmap::flipped(Gfx::Orientation orientation) const
+ErrorOr<NonnullRefPtr<Gfx::Bitmap>> Bitmap::flipped(Gfx::Orientation orientation) const
{
auto new_bitmap = Gfx::Bitmap::try_create(this->format(), { width(), height() }, scale());
- if (!new_bitmap)
- return nullptr;
+ if (!new_bitmap) {
+ // FIXME: Propagate the *real* error, once we have it.
+ return Error::from_errno(ENOMEM);
+ }
auto w = this->physical_width();
auto h = this->physical_height();
@@ -390,7 +392,7 @@ RefPtr<Gfx::Bitmap> Bitmap::flipped(Gfx::Orientation orientation) const
}
}
- return new_bitmap;
+ return new_bitmap.release_nonnull();
}
RefPtr<Gfx::Bitmap> Bitmap::scaled(int sx, int sy) const