java.lang.Object | ||
↳ | com.facebook.imagepipeline.animated.base.DelegatingAnimatedDrawableBackend | |
↳ | com.facebook.imagepipeline.animated.impl.AnimatedDrawableCachingBackendImpl |
A caching and prefetching layer that delegates to a AnimatedDrawableBackend
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AnimatedDrawableCachingBackendImpl(SerialExecutorService executorService, ActivityManager activityManager, AnimatedDrawableUtil animatedDrawableUtil, MonotonicClock monotonicClock, AnimatedDrawableBackend animatedDrawableBackend, AnimatedDrawableOptions options) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
appendDebugOptionString(StringBuilder sb)
Appends a string about the state of the backend that might be useful for debugging.
| ||||||||||
synchronized void |
dropCaches()
Instructs the backend to drop its caches.
| ||||||||||
AnimatedDrawableCachingBackend |
forNewBounds(Rect bounds)
Creates a new
AnimatedDrawableBackend with the same parameters but with a new bounds. | ||||||||||
CloseableReference<Bitmap> |
getBitmapForFrame(int frameNumber)
Gets the bitmap for the specified frame number.
| ||||||||||
int |
getMemoryUsage()
Gets the number of bytes currently used by the backend for caching (for debugging)
| ||||||||||
CloseableReference<Bitmap> |
getPreviewBitmap()
Gets the bitmap for the preview frame.
| ||||||||||
void |
renderFrame(int frameNumber, Canvas canvas)
Renders the specified frame onto the canvas.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void | finalize() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Appends a string about the state of the backend that might be useful for debugging.
sb | the builder to append to |
---|
Instructs the backend to drop its caches.
Creates a new AnimatedDrawableBackend
with the same parameters but with a new bounds.
bounds | the bounds |
---|
AnimatedDrawableBackend
with the new bounds (this may be the same instance
if the bounds don't require a new backend)
Gets the bitmap for the specified frame number. The bitmap should be the size of the
rendered image according to getRenderedWidth()
and getRenderedHeight()
and
ready to be drawn in the Drawable's draw method.
frameNumber | the frame number (0-based) |
---|
Gets the number of bytes currently used by the backend for caching (for debugging)
Gets the bitmap for the preview frame. This will only return non-null if the
ImageDecodeOptions
were configured to decode the preview frame.
Renders the specified frame onto the canvas.
frameNumber | the frame number (0-based) |
---|---|
canvas | the canvas to render onto |
Throwable |
---|