summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-24 17:00:28 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-25 14:11:34 +0200
commitdeec79b3c61b4444c54e0b159a517920ab841658 (patch)
tree166d55c1da90fa82f6627b54529fb75da0537eea /Userland
parentdeff554096652c461e62767b5e065e9d4c3ec9cc (diff)
downloadserenity-deec79b3c61b4444c54e0b159a517920ab841658.zip
LibGfx: Add try_ prefix to Bitmap::try_allocate_backing_store()
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGfx/Bitmap.cpp6
-rw-r--r--Userland/Libraries/LibGfx/Bitmap.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp
index a9c43dfed9..355941cd58 100644
--- a/Userland/Libraries/LibGfx/Bitmap.cpp
+++ b/Userland/Libraries/LibGfx/Bitmap.cpp
@@ -67,7 +67,7 @@ static bool size_would_overflow(BitmapFormat format, const IntSize& size, int sc
RefPtr<Bitmap> Bitmap::try_create(BitmapFormat format, const IntSize& size, int scale_factor)
{
- auto backing_store = Bitmap::allocate_backing_store(format, size, scale_factor, Purgeable::No);
+ auto backing_store = Bitmap::try_allocate_backing_store(format, size, scale_factor, Purgeable::No);
if (!backing_store.has_value())
return nullptr;
return adopt_ref(*new Bitmap(format, size, scale_factor, Purgeable::No, backing_store.value()));
@@ -75,7 +75,7 @@ RefPtr<Bitmap> Bitmap::try_create(BitmapFormat format, const IntSize& size, int
RefPtr<Bitmap> Bitmap::try_create_purgeable(BitmapFormat format, const IntSize& size, int scale_factor)
{
- auto backing_store = Bitmap::allocate_backing_store(format, size, scale_factor, Purgeable::Yes);
+ auto backing_store = Bitmap::try_allocate_backing_store(format, size, scale_factor, Purgeable::Yes);
if (!backing_store.has_value())
return nullptr;
return adopt_ref(*new Bitmap(format, size, scale_factor, Purgeable::Yes, backing_store.value()));
@@ -576,7 +576,7 @@ ShareableBitmap Bitmap::to_shareable_bitmap() const
return ShareableBitmap(*bitmap);
}
-Optional<BackingStore> Bitmap::allocate_backing_store(BitmapFormat format, const IntSize& size, int scale_factor, [[maybe_unused]] Purgeable purgeable)
+Optional<BackingStore> Bitmap::try_allocate_backing_store(BitmapFormat format, IntSize const& size, int scale_factor, [[maybe_unused]] Purgeable purgeable)
{
if (size_would_overflow(format, size, scale_factor))
return {};
diff --git a/Userland/Libraries/LibGfx/Bitmap.h b/Userland/Libraries/LibGfx/Bitmap.h
index 4e0c1d7c3d..b08622f6c3 100644
--- a/Userland/Libraries/LibGfx/Bitmap.h
+++ b/Userland/Libraries/LibGfx/Bitmap.h
@@ -243,7 +243,7 @@ private:
Bitmap(BitmapFormat, const IntSize&, int, size_t pitch, void*);
Bitmap(BitmapFormat, Core::AnonymousBuffer, const IntSize&, int, const Vector<RGBA32>& palette);
- static Optional<BackingStore> allocate_backing_store(BitmapFormat, const IntSize&, int, Purgeable);
+ static Optional<BackingStore> try_allocate_backing_store(BitmapFormat format, IntSize const& size, int scale_factor, Purgeable);
void allocate_palette_from_format(BitmapFormat, const Vector<RGBA32>& source_palette);