Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1941)

Unified Diff: Source/platform/image-decoders/ImageDecoder.cpp

Issue 136503002: Allow frames to be free'd even for static images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/platform/image-decoders/ImageDecoder.cpp
diff --git a/Source/platform/image-decoders/ImageDecoder.cpp b/Source/platform/image-decoders/ImageDecoder.cpp
index cb5774dffc510ff6718f93165df02db3011adc39..7208311fc2e2171b3b3ff7ea6211a3a03a82640f 100644
--- a/Source/platform/image-decoders/ImageDecoder.cpp
+++ b/Source/platform/image-decoders/ImageDecoder.cpp
@@ -134,8 +134,9 @@ unsigned ImageDecoder::frameBytesAtIndex(size_t index) const
size_t ImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
{
- // Don't clear if there are no frames or only one frame.
- if (m_frameBufferCache.size() <= 1)
+ // Don't clear if there are no frames or only one frame, and we're not
+ // specifically requested to clear all frames.
+ if (m_frameBufferCache.size() <= 1 && clearExceptFrame != kNotFound)
return 0;
Peter Kasting 2014/01/14 00:46:18 Nit: Can't we just implement this by removing this
fs 2014/01/14 08:32:09 Yes, true. Will drop this block.
size_t frameBytesCleared = 0;

Powered by Google App Engine
This is Rietveld 408576698