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

Unified Diff: Source/core/platform/graphics/BitmapImage.h

Issue 15350006: Decode GIF image frames on demand. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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/core/platform/graphics/BitmapImage.h
diff --git a/Source/core/platform/graphics/BitmapImage.h b/Source/core/platform/graphics/BitmapImage.h
index f4f17b28439bf079e592db8265c9d2a606f0c57b..d3906c9d4c11fc83facb02c624ae965b3d4b58b2 100644
--- a/Source/core/platform/graphics/BitmapImage.h
+++ b/Source/core/platform/graphics/BitmapImage.h
@@ -166,22 +166,18 @@ protected:
// Called before accessing m_frames[index]. Returns false on index out of bounds.
bool ensureFrameIsCached(size_t index);
- // Called to invalidate cached data. When |destroyAll| is true, we wipe out
- // the entire frame buffer cache and tell the image source to destroy
- // everything; this is used when e.g. we want to free some room in the image
- // cache. If |destroyAll| is false, we only delete frames up to the current
- // one; this is used while animating large images to keep memory footprint
- // low without redecoding the whole image on every frame.
- virtual void destroyDecodedData(bool destroyAll = true);
-
- // If the image is large enough, calls destroyDecodedData() and passes
- // |destroyAll| along.
- void destroyDecodedDataIfNecessary(bool destroyAll);
+ // Called to invalidate cached data. This is used while animating large
+ // images to keep memory footprint low. The decoder may preserve some frames
+ // to avoid redecoding the whole image on every frame.
+ virtual void destroyDecodedData() OVERRIDE;
Peter Kasting 2013/05/29 02:02:18 Nit: I'm a big fan of OVERRIDE, but if we're addin
Xianzhu 2013/05/29 18:37:01 Done.
+
+ // If the image is large enough, calls destroyDecodedData().
+ void destroyDecodedDataIfNecessary();
// Generally called by destroyDecodedData(), destroys whole-image metadata
// and notifies observers that the memory footprint has (hopefully)
// decreased by |frameBytesCleared|.
- void destroyMetadataAndNotify(unsigned frameBytesCleared);
+ void destroyMetadataAndNotify(size_t frameBytesCleared);
// Whether or not size is available yet.
bool isSizeAvailable();

Powered by Google App Engine
This is Rietveld 408576698