1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:37:35 +00:00

LibGfx: Use ErrorOr<T> for Bitmap::clone()

This commit is contained in:
Andreas Kling 2021-11-06 11:52:35 +01:00
parent c417820bff
commit 2da4cfcc80
6 changed files with 23 additions and 11 deletions

View file

@ -172,8 +172,7 @@ void Card::clear_and_draw(GUI::Painter& painter, const Color& background_color)
NonnullRefPtr<Gfx::Bitmap> Card::invert_bitmap(Gfx::Bitmap& bitmap)
{
auto inverted_bitmap = bitmap.clone();
VERIFY(inverted_bitmap);
auto inverted_bitmap = bitmap.clone().release_value_but_fixme_should_propagate_errors();
for (int y = 0; y < inverted_bitmap->height(); y++) {
for (int x = 0; x < inverted_bitmap->width(); x++) {
inverted_bitmap->set_pixel(x, y, inverted_bitmap->get_pixel(x, y).inverted());