1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:37:46 +00:00

LibGfx: Use ErrorOr<T> for Bitmap infrastructure used by ShareableBitmap

This also allows us to get rid of the ShareableBitmap(Bitmap)
constructor which was easy to misuse. Everyone now uses Bitmap's
to_shareable_bitmap() helper instead.
This commit is contained in:
Andreas Kling 2021-11-06 13:15:43 +01:00
parent 8262bbf624
commit 09cba7c780
5 changed files with 13 additions and 22 deletions

View file

@ -15,7 +15,6 @@ namespace Gfx {
class ShareableBitmap {
public:
ShareableBitmap() { }
explicit ShareableBitmap(const Gfx::Bitmap&);
enum Tag { ConstructWithKnownGoodBitmap };
ShareableBitmap(NonnullRefPtr<Gfx::Bitmap>, Tag);
@ -26,6 +25,8 @@ public:
Bitmap* bitmap() { return m_bitmap; }
private:
friend class Bitmap;
RefPtr<Bitmap> m_bitmap;
};