|
@@ -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
|