diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-21 18:02:15 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-21 18:02:15 +0200 |
commit | c7d891765cc87ec04f8d332b93fc7c3f82521d7f (patch) | |
tree | 9d414d3ad62e0193b1b6fb0d12079e11e96e69b1 /Userland/Libraries/LibGL/SoftwareRasterizer.cpp | |
parent | f0409081f562b635de3a23d7babbc7348cbb970c (diff) | |
download | serenity-c7d891765cc87ec04f8d332b93fc7c3f82521d7f.zip |
LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
Diffstat (limited to 'Userland/Libraries/LibGL/SoftwareRasterizer.cpp')
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareRasterizer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGL/SoftwareRasterizer.cpp b/Userland/Libraries/LibGL/SoftwareRasterizer.cpp index 41f4a48b1b..8ef38b1a24 100644 --- a/Userland/Libraries/LibGL/SoftwareRasterizer.cpp +++ b/Userland/Libraries/LibGL/SoftwareRasterizer.cpp @@ -409,7 +409,7 @@ static Gfx::IntSize closest_multiple(const Gfx::IntSize& min_size, size_t step) } SoftwareRasterizer::SoftwareRasterizer(const Gfx::IntSize& min_size) - : m_render_target { Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, closest_multiple(min_size, RASTERIZER_BLOCK_SIZE)) } + : m_render_target { Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, closest_multiple(min_size, RASTERIZER_BLOCK_SIZE)) } , m_depth_buffer { adopt_own(*new DepthBuffer(closest_multiple(min_size, RASTERIZER_BLOCK_SIZE))) } { } @@ -446,7 +446,7 @@ void SoftwareRasterizer::resize(const Gfx::IntSize& min_size) { wait_for_all_threads(); - m_render_target = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, closest_multiple(min_size, RASTERIZER_BLOCK_SIZE)); + m_render_target = Gfx::Bitmap::try_create(Gfx::BitmapFormat::BGRA8888, closest_multiple(min_size, RASTERIZER_BLOCK_SIZE)); m_depth_buffer = adopt_own(*new DepthBuffer(m_render_target->size())); } |