Search in sources :

Example 1 with AnimatedDrawableBackendFrameRenderer

use of com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendFrameRenderer in project fresco by facebook.

the class ExperimentalBitmapAnimationDrawableFactory method createAnimationBackend.

private AnimationBackend createAnimationBackend(AnimatedImageResult animatedImageResult, @Nullable Bitmap.Config animatedBitmapConig) {
    AnimatedDrawableBackend animatedDrawableBackend = createAnimatedDrawableBackend(animatedImageResult);
    BitmapFrameCache bitmapFrameCache = createBitmapFrameCache(animatedImageResult);
    BitmapFrameRenderer bitmapFrameRenderer = new AnimatedDrawableBackendFrameRenderer(bitmapFrameCache, animatedDrawableBackend);
    int numberOfFramesToPrefetch = mNumberOfFramesToPrepareSupplier.get();
    BitmapFramePreparationStrategy bitmapFramePreparationStrategy = null;
    BitmapFramePreparer bitmapFramePreparer = null;
    if (numberOfFramesToPrefetch > 0) {
        bitmapFramePreparationStrategy = new FixedNumberBitmapFramePreparationStrategy(numberOfFramesToPrefetch);
        bitmapFramePreparer = createBitmapFramePreparer(bitmapFrameRenderer, animatedBitmapConig);
    }
    BitmapAnimationBackend bitmapAnimationBackend = new BitmapAnimationBackend(mPlatformBitmapFactory, bitmapFrameCache, new AnimatedDrawableBackendAnimationInformation(animatedDrawableBackend), bitmapFrameRenderer, bitmapFramePreparationStrategy, bitmapFramePreparer);
    return AnimationBackendDelegateWithInactivityCheck.createForBackend(bitmapAnimationBackend, mMonotonicClock, mScheduledExecutorServiceForUiThread);
}
Also used : AnimatedDrawableBackend(com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend) AnimatedDrawableBackendFrameRenderer(com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendFrameRenderer) AnimatedDrawableBackendAnimationInformation(com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendAnimationInformation) BitmapFramePreparationStrategy(com.facebook.fresco.animation.bitmap.preparation.BitmapFramePreparationStrategy) FixedNumberBitmapFramePreparationStrategy(com.facebook.fresco.animation.bitmap.preparation.FixedNumberBitmapFramePreparationStrategy) BitmapAnimationBackend(com.facebook.fresco.animation.bitmap.BitmapAnimationBackend) BitmapFrameCache(com.facebook.fresco.animation.bitmap.BitmapFrameCache) BitmapFrameRenderer(com.facebook.fresco.animation.bitmap.BitmapFrameRenderer) BitmapFramePreparer(com.facebook.fresco.animation.bitmap.preparation.BitmapFramePreparer) DefaultBitmapFramePreparer(com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer) FixedNumberBitmapFramePreparationStrategy(com.facebook.fresco.animation.bitmap.preparation.FixedNumberBitmapFramePreparationStrategy)

Example 2 with AnimatedDrawableBackendFrameRenderer

use of com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendFrameRenderer in project fresco by facebook.

the class ExperimentalBitmapAnimationDrawableFactory method createAnimationBackend.

private AnimationBackend createAnimationBackend(AnimatedImageResult animatedImageResult) {
    AnimatedDrawableBackend animatedDrawableBackend = createAnimatedDrawableBackend(animatedImageResult);
    BitmapFrameCache bitmapFrameCache = createBitmapFrameCache(animatedImageResult);
    BitmapAnimationBackend bitmapAnimationBackend = new BitmapAnimationBackend(mPlatformBitmapFactory, bitmapFrameCache, new AnimatedDrawableBackendAnimationInformation(animatedDrawableBackend), new AnimatedDrawableBackendFrameRenderer(bitmapFrameCache, animatedDrawableBackend));
    return AnimationBackendDelegateWithInactivityCheck.createForBackend(bitmapAnimationBackend, mMonotonicClock, mScheduledExecutorServiceForUiThread);
}
Also used : AnimatedDrawableBackend(com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend) AnimatedDrawableBackendFrameRenderer(com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendFrameRenderer) AnimatedDrawableBackendAnimationInformation(com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendAnimationInformation) BitmapAnimationBackend(com.facebook.fresco.animation.bitmap.BitmapAnimationBackend) BitmapFrameCache(com.facebook.fresco.animation.bitmap.BitmapFrameCache)

Aggregations

BitmapAnimationBackend (com.facebook.fresco.animation.bitmap.BitmapAnimationBackend)2 BitmapFrameCache (com.facebook.fresco.animation.bitmap.BitmapFrameCache)2 AnimatedDrawableBackendAnimationInformation (com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendAnimationInformation)2 AnimatedDrawableBackendFrameRenderer (com.facebook.fresco.animation.bitmap.wrapper.AnimatedDrawableBackendFrameRenderer)2 AnimatedDrawableBackend (com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend)2 BitmapFrameRenderer (com.facebook.fresco.animation.bitmap.BitmapFrameRenderer)1 BitmapFramePreparationStrategy (com.facebook.fresco.animation.bitmap.preparation.BitmapFramePreparationStrategy)1 BitmapFramePreparer (com.facebook.fresco.animation.bitmap.preparation.BitmapFramePreparer)1 DefaultBitmapFramePreparer (com.facebook.fresco.animation.bitmap.preparation.DefaultBitmapFramePreparer)1 FixedNumberBitmapFramePreparationStrategy (com.facebook.fresco.animation.bitmap.preparation.FixedNumberBitmapFramePreparationStrategy)1