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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h

Issue 1574283002: GIF Animations "clear from cache related glitch" fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
index 2ebd7797caf99844abc34018d95e42f885f8b453..fd0fbd7d66d8726aa59f18658ff558163947d22e 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -35,6 +35,7 @@
#include "platform/image-decoders/ImageFrame.h"
#include "public/platform/Platform.h"
#include "wtf/Assertions.h"
+#include "wtf/HashSet.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/Threading.h"
@@ -46,6 +47,7 @@
#endif
typedef Vector<char> ColorProfile;
+typedef HashSet<size_t, WTF::IntHash<size_t>, WTF::UnsignedWithZeroKeyHashTraits<size_t>> SizeTHashSet;
namespace blink {
@@ -334,6 +336,12 @@ protected:
// Decodes the requested frame.
virtual void decode(size_t) = 0;
+ // Clears decoded pixel data from all frames except the provided frames.
+ // Callers may pass WTF::kNotFound to clear all frames.
+ // Note: If |m_frameBufferCache| contains only one frame, it won't be cleared.
+ // Returns the number of bytes of frame data actually cleared.
+ size_t clearCacheExceptFrames(const SizeTHashSet&);
+
RefPtr<SharedBuffer> m_data; // The encoded data.
Vector<ImageFrame, 1> m_frameBufferCache;
bool m_premultiplyAlpha;

Powered by Google App Engine
This is Rietveld 408576698