summaryrefslogtreecommitdiff
path: root/Userland/Demos/Mandelbrot
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-21 18:02:15 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-21 18:02:15 +0200
commitc7d891765cc87ec04f8d332b93fc7c3f82521d7f (patch)
tree9d414d3ad62e0193b1b6fb0d12079e11e96e69b1 /Userland/Demos/Mandelbrot
parentf0409081f562b635de3a23d7babbc7348cbb970c (diff)
downloadserenity-c7d891765cc87ec04f8d332b93fc7c3f82521d7f.zip
LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
Diffstat (limited to 'Userland/Demos/Mandelbrot')
-rw-r--r--Userland/Demos/Mandelbrot/Mandelbrot.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp
index d481e827f2..a230f1b1b9 100644
--- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp
+++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp
@@ -35,7 +35,7 @@ public:
void resize(Gfx::IntSize const& size)
{
- m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, size);
+ m_bitmap = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, size);
correct_aspect();
calculate();
}
@@ -264,7 +264,7 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& file_menu = menubar->add_menu("&File");
- file_menu.add_action(GUI::Action::create("&Export...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"),
+ file_menu.add_action(GUI::Action::create("&Export...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save.png"),
[&](GUI::Action&) {
Optional<String> export_path = GUI::FilePicker::get_save_filepath(window, "untitled", "png");
if (!export_path.has_value())