mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:37:44 +00:00
LibGfx: Remove try_
prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit it.
This commit is contained in:
parent
1971bff314
commit
82a152b696
186 changed files with 598 additions and 598 deletions
|
@ -692,7 +692,7 @@ static void load_page_for_screenshot_and_exit(HeadlessBrowserPageClient& page_cl
|
|||
auto output_file = MUST(Core::Stream::File::open(output_file_path, Core::Stream::OpenMode::Write));
|
||||
|
||||
auto output_rect = page_client.screen_rect();
|
||||
auto output_bitmap = MUST(Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRx8888, output_rect.size().to_type<int>()));
|
||||
auto output_bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, output_rect.size().to_type<int>()));
|
||||
|
||||
page_client.paint(output_rect, output_bitmap);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
args_parser.add_positional_argument(path, "Path to image", "path");
|
||||
args_parser.parse(arguments);
|
||||
|
||||
auto bitmap = TRY(Gfx::Bitmap::try_load_from_file(path));
|
||||
auto bitmap = TRY(Gfx::Bitmap::load_from_file(path));
|
||||
|
||||
TRY(Core::System::pledge("stdio"));
|
||||
Vector<u8> data;
|
||||
|
|
|
@ -27,7 +27,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
notification->set_text(message);
|
||||
notification->set_title(title);
|
||||
if (!icon_path.is_empty()) {
|
||||
notification->set_icon(TRY(Gfx::Bitmap::try_load_from_file(icon_path)));
|
||||
notification->set_icon(TRY(Gfx::Bitmap::load_from_file(icon_path)));
|
||||
}
|
||||
notification->show();
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
return Error::from_string_literal("No wallpapers found");
|
||||
|
||||
auto& chosen_wallpaper_path = wallpaper_paths.at(get_random_uniform(wallpaper_paths.size()));
|
||||
auto chosen_wallpaper_bitmap = TRY(Gfx::Bitmap::try_load_from_file(chosen_wallpaper_path));
|
||||
auto chosen_wallpaper_bitmap = TRY(Gfx::Bitmap::load_from_file(chosen_wallpaper_path));
|
||||
if (!GUI::Desktop::the().set_wallpaper(chosen_wallpaper_bitmap, chosen_wallpaper_path))
|
||||
return Error::from_string_literal("Failed to set wallpaper");
|
||||
|
||||
|
@ -74,7 +74,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (path.is_null())
|
||||
return Error::from_string_literal("Must provide a path to a wallpaper");
|
||||
|
||||
auto wallpaper_bitmap = TRY(Gfx::Bitmap::try_load_from_file(path));
|
||||
auto wallpaper_bitmap = TRY(Gfx::Bitmap::load_from_file(path));
|
||||
if (!GUI::Desktop::the().set_wallpaper(wallpaper_bitmap, path))
|
||||
return Error::from_string_literal("Failed to set wallpaper");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue