Search in sources :

Example 1 with BitmapMemoryCacheTrimStrategy

use of com.facebook.imagepipeline.cache.BitmapMemoryCacheTrimStrategy in project fresco by facebook.

the class AnimatedFrameCacheTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    MemoryCacheParams params = new MemoryCacheParams(4 * ByteConstants.MB, 256, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, TimeUnit.MINUTES.toMillis(5));
    when(mMemoryCacheParamsSupplier.get()).thenReturn(params);
    CountingMemoryCache<CacheKey, CloseableImage> countingMemoryCache = new CountingLruBitmapMemoryCacheFactory().create(mMemoryCacheParamsSupplier, mMemoryTrimmableRegistry, new BitmapMemoryCacheTrimStrategy(), false, false, null);
    mCacheKey = new SimpleCacheKey("key");
    mAnimatedFrameCache = new AnimatedFrameCache(mCacheKey, countingMemoryCache);
    mFrame1 = CloseableReference.of(mock(CloseableImage.class));
    mFrame2 = CloseableReference.of(mock(CloseableImage.class));
}
Also used : MemoryCacheParams(com.facebook.imagepipeline.cache.MemoryCacheParams) BitmapMemoryCacheTrimStrategy(com.facebook.imagepipeline.cache.BitmapMemoryCacheTrimStrategy) SimpleCacheKey(com.facebook.cache.common.SimpleCacheKey) CloseableImage(com.facebook.imagepipeline.image.CloseableImage) CacheKey(com.facebook.cache.common.CacheKey) SimpleCacheKey(com.facebook.cache.common.SimpleCacheKey) CountingLruBitmapMemoryCacheFactory(com.facebook.imagepipeline.cache.CountingLruBitmapMemoryCacheFactory) Before(org.junit.Before)

Aggregations

CacheKey (com.facebook.cache.common.CacheKey)1 SimpleCacheKey (com.facebook.cache.common.SimpleCacheKey)1 BitmapMemoryCacheTrimStrategy (com.facebook.imagepipeline.cache.BitmapMemoryCacheTrimStrategy)1 CountingLruBitmapMemoryCacheFactory (com.facebook.imagepipeline.cache.CountingLruBitmapMemoryCacheFactory)1 MemoryCacheParams (com.facebook.imagepipeline.cache.MemoryCacheParams)1 CloseableImage (com.facebook.imagepipeline.image.CloseableImage)1 Before (org.junit.Before)1