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

LibGfx: Short-circuit ShareableBitmap construction in IPC decoder

When decoding a ShareableBitmap that came over IPC, it's safe to assume
that it's backed by an anonymous file (since we just decoded it.)
This commit is contained in:
Andreas Kling 2021-01-16 11:23:22 +01:00
parent f18d89b36d
commit 58b435f49e
2 changed files with 11 additions and 1 deletions

View file

@ -37,6 +37,9 @@ public:
ShareableBitmap() { }
explicit ShareableBitmap(const Gfx::Bitmap&);
enum Tag { ConstructWithKnownGoodBitmap };
ShareableBitmap(NonnullRefPtr<Gfx::Bitmap>, Tag);
bool is_valid() const { return m_bitmap; }
const Bitmap* bitmap() const { return m_bitmap; }