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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp

Issue 2516593003: Pull up clearCacheExceptFrame to ImageDecoder. (Closed)
Patch Set: Add todo for changing MockImageDecoder Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 504b59a0a192b5f6cf363f98c3bd8e0f598362ee..7456b179453fcb96d293880471d5f1db30780a34 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -265,35 +265,6 @@ bool WEBPImageDecoder::canReusePreviousFrameBuffer(size_t frameIndex) const {
ImageFrame::BlendAtopPreviousFrame;
}
-size_t WEBPImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame) {
- // Don't clear if there are no frames, or only one.
- if (m_frameBufferCache.size() <= 1)
- return 0;
-
- // If |clearExceptFrame| has status FrameComplete, we only preserve that
- // frame. Otherwise, we *also* preserve the most recent previous frame with
- // status FrameComplete whose data will be required to decode
- // |clearExceptFrame|, either in initFrameBuffer() or ApplyPostProcessing().
- // This frame index is stored in |clearExceptFrame2|. All other frames can
- // be cleared.
- size_t clearExceptFrame2 = kNotFound;
- if (clearExceptFrame < m_frameBufferCache.size() &&
- m_frameBufferCache[clearExceptFrame].getStatus() !=
- ImageFrame::FrameComplete) {
- clearExceptFrame2 =
- m_frameBufferCache[clearExceptFrame].requiredPreviousFrameIndex();
- }
-
- while ((clearExceptFrame2 < m_frameBufferCache.size()) &&
- (m_frameBufferCache[clearExceptFrame2].getStatus() !=
- ImageFrame::FrameComplete)) {
- clearExceptFrame2 =
- m_frameBufferCache[clearExceptFrame2].requiredPreviousFrameIndex();
- }
-
- return clearCacheExceptTwoFrames(clearExceptFrame, clearExceptFrame2);
-}
-
void WEBPImageDecoder::clearFrameBuffer(size_t frameIndex) {
if (m_demux && m_demuxState >= WEBP_DEMUX_PARSED_HEADER &&
m_frameBufferCache[frameIndex].getStatus() == ImageFrame::FramePartial) {
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698