java.lang.Object | |
↳ | com.facebook.imagepipeline.animated.impl.AnimatedFrameCache |
Facade to the image memory cache for frames of an animated image.
Each animated image should have its own instance of this class.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AnimatedFrameCache(CacheKey imageCacheKey, CountingMemoryCache<CacheKey, CloseableImage> backingCache) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CloseableReference<CloseableImage> |
cache(int frameIndex, CloseableReference<CloseableImage> imageRef)
Caches the image for the given frame index.
| ||||||||||
boolean |
contains(int frameIndex)
Check whether the cache contains an image for the given frame index.
| ||||||||||
CloseableReference<CloseableImage> |
get(int frameIndex)
Gets the image for the given frame index.
| ||||||||||
CloseableReference<CloseableImage> |
getForReuse()
Gets the image to be reused, or null if there is no such image.
| ||||||||||
synchronized void | onReusabilityChange(CacheKey key, boolean isReusable) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Caches the image for the given frame index.
Important: the client should use the returned reference instead of the original one. It is the caller's responsibility to close the returned reference once not needed anymore.
Check whether the cache contains an image for the given frame index.
Gets the image for the given frame index.
It is the caller's responsibility to close the returned reference once not needed anymore.
Gets the image to be reused, or null if there is no such image.
The returned image is the least recently used image that has no more clients referencing it, and it has not yet been evicted from the cache.
The client can freely modify the bitmap of the returned image and can cache it again without any restrictions.