1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

LibDraw: Create purgeable GraphicsBitmap in the PNG decoder

Also add ImageDecoder APIs for controlling the volatile flag.
This commit is contained in:
Andreas Kling 2019-12-18 20:50:58 +01:00
parent 77ae98a9b6
commit 7cc4b90b16
3 changed files with 21 additions and 1 deletions

View file

@ -14,6 +14,9 @@ public:
virtual Size size() = 0;
virtual RefPtr<GraphicsBitmap> bitmap() = 0;
virtual void set_volatile() = 0;
[[nodiscard]] virtual bool set_nonvolatile() = 0;
protected:
ImageDecoderPlugin() {}
};
@ -27,6 +30,8 @@ public:
int width() const { return size().width(); }
int height() const { return size().height(); }
RefPtr<GraphicsBitmap> bitmap() const { return m_plugin->bitmap(); }
void set_volatile() { m_plugin->set_volatile(); }
[[nodiscard]] bool set_nonvolatile() { return m_plugin->set_nonvolatile(); }
private:
ImageDecoder(const u8*, size_t);