Chromium Code Reviews| 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; |