diff options
Diffstat (limited to 'Libraries/LibDraw/PNGLoader.cpp')
-rw-r--r-- | Libraries/LibDraw/PNGLoader.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Libraries/LibDraw/PNGLoader.cpp b/Libraries/LibDraw/PNGLoader.cpp index 3c157df745..508641f1f0 100644 --- a/Libraries/LibDraw/PNGLoader.cpp +++ b/Libraries/LibDraw/PNGLoader.cpp @@ -515,7 +515,7 @@ static bool decode_png_bitmap(PNGLoadingContext& context) #ifdef PNG_STOPWATCH_DEBUG Stopwatch sw("load_png_impl: create bitmap"); #endif - context.bitmap = GraphicsBitmap::create(context.has_alpha() ? GraphicsBitmap::Format::RGBA32 : GraphicsBitmap::Format::RGB32, { context.width, context.height }); + context.bitmap = GraphicsBitmap::create_purgeable(context.has_alpha() ? GraphicsBitmap::Format::RGBA32 : GraphicsBitmap::Format::RGB32, { context.width, context.height }); } unfilter(context); @@ -701,3 +701,16 @@ RefPtr<GraphicsBitmap> PNGImageDecoderPlugin::bitmap() ASSERT(m_context->bitmap); return m_context->bitmap; } + +void PNGImageDecoderPlugin::set_volatile() +{ + if (m_context->bitmap) + m_context->bitmap->set_volatile(); +} + +bool PNGImageDecoderPlugin::set_nonvolatile() +{ + if (!m_context->bitmap) + return false; + return m_context->bitmap->set_nonvolatile(); +} |