private CacheKey getCacheKey() { final ImageRequest imageRequest = getImageRequest(); final CacheKeyFactory cacheKeyFactory = mImagePipeline.getCacheKeyFactory(); CacheKey cacheKey = null; if (cacheKeyFactory != null && imageRequest != null) { if (imageRequest.getPostprocessor() != null) { cacheKey = cacheKeyFactory.getPostprocessedBitmapCacheKey( imageRequest, getCallerContext()); } else { cacheKey = cacheKeyFactory.getBitmapCacheKey( imageRequest, getCallerContext()); } } return cacheKey; }
ProducerFactory createProducerFactory( Context context, ByteArrayPool byteArrayPool, ImageDecoder imageDecoder, ProgressiveJpegConfig progressiveJpegConfig, boolean downsampleEnabled, boolean resizeAndRotateEnabledForNetwork, boolean decodeCancellationEnabled, Supplier<Boolean> experimentalSmartResizingEnabled, ExecutorSupplier executorSupplier, PooledByteBufferFactory pooledByteBufferFactory, MemoryCache<CacheKey, CloseableImage> bitmapMemoryCache, MemoryCache<CacheKey, PooledByteBuffer> encodedMemoryCache, BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, MediaVariationsIndex mediaVariationsIndex, CacheKeyFactory cacheKeyFactory, PlatformBitmapFactory platformBitmapFactory, int bitmapPrepareToDrawMinSizeBytes, int bitmapPrepareToDrawMaxSizeBytes, boolean bitmapPrepareToDrawForPrefetch);
public ImagePipeline( ProducerSequenceFactory producerSequenceFactory, Set<RequestListener> requestListeners, Supplier<Boolean> isPrefetchEnabledSupplier, MemoryCache<CacheKey, CloseableImage> bitmapMemoryCache, MemoryCache<CacheKey, PooledByteBuffer> encodedMemoryCache, BufferedDiskCache mainBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory, ThreadHandoffProducerQueue threadHandoffProducerQueue, Supplier<Boolean> suppressBitmapPrefetchingSupplier) { mIdCounter = new AtomicLong(); mProducerSequenceFactory = producerSequenceFactory; mRequestListener = new ForwardingRequestListener(requestListeners); mIsPrefetchEnabledSupplier = isPrefetchEnabledSupplier; mBitmapMemoryCache = bitmapMemoryCache; mEncodedMemoryCache = encodedMemoryCache; mMainBufferedDiskCache = mainBufferedDiskCache; mSmallImageBufferedDiskCache = smallImageBufferedDiskCache; mCacheKeyFactory = cacheKeyFactory; mThreadHandoffProducerQueue = threadHandoffProducerQueue; mSuppressBitmapPrefetchingSupplier = suppressBitmapPrefetchingSupplier; }
public EncodedMemoryCacheProducer( MemoryCache<CacheKey, PooledByteBuffer> memoryCache, CacheKeyFactory cacheKeyFactory, Producer<EncodedImage> inputProducer) { mMemoryCache = memoryCache; mCacheKeyFactory = cacheKeyFactory; mInputProducer = inputProducer; }
public BitmapMemoryCacheProducer( MemoryCache<CacheKey, CloseableImage> memoryCache, CacheKeyFactory cacheKeyFactory, Producer<CloseableReference<CloseableImage>> inputProducer) { mMemoryCache = memoryCache; mCacheKeyFactory = cacheKeyFactory; mInputProducer = inputProducer; }
public PostprocessedBitmapMemoryCacheProducer( MemoryCache<CacheKey, CloseableImage> memoryCache, CacheKeyFactory cacheKeyFactory, Producer<CloseableReference<CloseableImage>> inputProducer) { mMemoryCache = memoryCache; mCacheKeyFactory = cacheKeyFactory; mInputProducer = inputProducer; }
public MediaVariationsFallbackProducer( BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory, MediaVariationsIndex mediaVariationsIndex, Producer<EncodedImage> inputProducer) { mDefaultBufferedDiskCache = defaultBufferedDiskCache; mSmallImageBufferedDiskCache = smallImageBufferedDiskCache; mCacheKeyFactory = cacheKeyFactory; mMediaVariationsIndex = mediaVariationsIndex; mInputProducer = inputProducer; }
public DiskCacheReadProducer( BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory, Producer<EncodedImage> inputProducer) { mDefaultBufferedDiskCache = defaultBufferedDiskCache; mSmallImageBufferedDiskCache = smallImageBufferedDiskCache; mCacheKeyFactory = cacheKeyFactory; mInputProducer = inputProducer; }
public DiskCacheWriteProducer( BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory, Producer<EncodedImage> inputProducer) { mDefaultBufferedDiskCache = defaultBufferedDiskCache; mSmallImageBufferedDiskCache = smallImageBufferedDiskCache; mCacheKeyFactory = cacheKeyFactory; mInputProducer = inputProducer; }
private DiskCacheWriteConsumer( final Consumer<EncodedImage> consumer, final ProducerContext producerContext, final BufferedDiskCache defaultBufferedDiskCache, final BufferedDiskCache smallImageBufferedDiskCache, final CacheKeyFactory cacheKeyFactory) { super(consumer); mProducerContext = producerContext; mDefaultBufferedDiskCache = defaultBufferedDiskCache; mSmallImageBufferedDiskCache = smallImageBufferedDiskCache; mCacheKeyFactory = cacheKeyFactory; }
public PartialDiskCacheProducer( BufferedDiskCache defaultBufferedDiskCache, CacheKeyFactory cacheKeyFactory, PooledByteBufferFactory pooledByteBufferFactory, ByteArrayPool byteArrayPool, Producer<EncodedImage> inputProducer) { mDefaultBufferedDiskCache = defaultBufferedDiskCache; mCacheKeyFactory = cacheKeyFactory; mPooledByteBufferFactory = pooledByteBufferFactory; mByteArrayPool = byteArrayPool; mInputProducer = inputProducer; }
public EncodedCacheKeyMultiplexProducer( CacheKeyFactory cacheKeyFactory, Producer inputProducer) { super(inputProducer); mCacheKeyFactory = cacheKeyFactory; }
public BitmapMemoryCacheKeyMultiplexProducer( CacheKeyFactory cacheKeyFactory, Producer inputProducer) { super(inputProducer); mCacheKeyFactory = cacheKeyFactory; }
public BitmapMemoryCacheGetProducer( MemoryCache<CacheKey, CloseableImage> memoryCache, CacheKeyFactory cacheKeyFactory, Producer<CloseableReference<CloseableImage>> inputProducer) { super(memoryCache, cacheKeyFactory, inputProducer); }
@Override public ProducerFactory createProducerFactory( Context context, ByteArrayPool byteArrayPool, ImageDecoder imageDecoder, ProgressiveJpegConfig progressiveJpegConfig, boolean downsampleEnabled, boolean resizeAndRotateEnabledForNetwork, boolean decodeCancellationEnabled, Supplier<Boolean> experimentalSmartResizingEnabled, ExecutorSupplier executorSupplier, PooledByteBufferFactory pooledByteBufferFactory, MemoryCache<CacheKey, CloseableImage> bitmapMemoryCache, MemoryCache<CacheKey, PooledByteBuffer> encodedMemoryCache, BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, MediaVariationsIndex mediaVariationsIndex, CacheKeyFactory cacheKeyFactory, PlatformBitmapFactory platformBitmapFactory, int bitmapPrepareToDrawMinSizeBytes, int bitmapPrepareToDrawMaxSizeBytes, boolean bitmapPrepareToDrawForPrefetch) { return new ProducerFactory( context, byteArrayPool, imageDecoder, progressiveJpegConfig, downsampleEnabled, resizeAndRotateEnabledForNetwork, decodeCancellationEnabled, experimentalSmartResizingEnabled, executorSupplier, pooledByteBufferFactory, bitmapMemoryCache, encodedMemoryCache, defaultBufferedDiskCache, smallImageBufferedDiskCache, mediaVariationsIndex, cacheKeyFactory, platformBitmapFactory, bitmapPrepareToDrawMinSizeBytes, bitmapPrepareToDrawMaxSizeBytes, bitmapPrepareToDrawForPrefetch); }
public CacheKeyFactory getCacheKeyFactory() { return mCacheKeyFactory; }
public Builder setCacheKeyFactory(CacheKeyFactory cacheKeyFactory) { mCacheKeyFactory = cacheKeyFactory; return this; }
public ProducerFactory( Context context, ByteArrayPool byteArrayPool, ImageDecoder imageDecoder, ProgressiveJpegConfig progressiveJpegConfig, boolean downsampleEnabled, boolean resizeAndRotateEnabledForNetwork, boolean decodeCancellationEnabled, Supplier<Boolean> experimentalSmartResizingEnabled, ExecutorSupplier executorSupplier, PooledByteBufferFactory pooledByteBufferFactory, MemoryCache<CacheKey, CloseableImage> bitmapMemoryCache, MemoryCache<CacheKey, PooledByteBuffer> encodedMemoryCache, BufferedDiskCache defaultBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, MediaVariationsIndex mediaVariationsIndex, CacheKeyFactory cacheKeyFactory, PlatformBitmapFactory platformBitmapFactory, int bitmapPrepareToDrawMinSizeBytes, int bitmapPrepareToDrawMaxSizeBytes, boolean bitmapPrepareToDrawForPrefetch) { mContentResolver = context.getApplicationContext().getContentResolver(); mResources = context.getApplicationContext().getResources(); mAssetManager = context.getApplicationContext().getAssets(); mByteArrayPool = byteArrayPool; mImageDecoder = imageDecoder; mProgressiveJpegConfig = progressiveJpegConfig; mDownsampleEnabled = downsampleEnabled; mResizeAndRotateEnabledForNetwork = resizeAndRotateEnabledForNetwork; mDecodeCancellationEnabled = decodeCancellationEnabled; mExperimentalSmartResizingEnabled = experimentalSmartResizingEnabled; mExecutorSupplier = executorSupplier; mPooledByteBufferFactory = pooledByteBufferFactory; mBitmapMemoryCache = bitmapMemoryCache; mEncodedMemoryCache = encodedMemoryCache; mDefaultBufferedDiskCache = defaultBufferedDiskCache; mSmallImageBufferedDiskCache = smallImageBufferedDiskCache; mMediaVariationsIndex = mediaVariationsIndex; mCacheKeyFactory = cacheKeyFactory; mPlatformBitmapFactory = platformBitmapFactory; mBitmapPrepareToDrawMinSizeBytes = bitmapPrepareToDrawMinSizeBytes; mBitmapPrepareToDrawMaxSizeBytes = bitmapPrepareToDrawMaxSizeBytes; mBitmapPrepareToDrawForPrefetch = bitmapPrepareToDrawForPrefetch; }
/** * @return The CacheKeyFactory implementation used by ImagePipeline */ public CacheKeyFactory getCacheKeyFactory() { return mCacheKeyFactory; }