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:
parent
77ae98a9b6
commit
7cc4b90b16
3 changed files with 21 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue