Search in sources :

Example 1 with DiskCacheReadProducer

use of com.facebook.imagepipeline.producers.DiskCacheReadProducer in project fresco by facebook.

the class ProducerSequenceFactory method newDiskCacheSequence.

private Producer<EncodedImage> newDiskCacheSequence(Producer<EncodedImage> inputProducer) {
    Producer<EncodedImage> cacheWriteProducer;
    if (FrescoSystrace.isTracing()) {
        FrescoSystrace.beginSection("ProducerSequenceFactory#newDiskCacheSequence");
    }
    if (mPartialImageCachingEnabled) {
        Producer<EncodedImage> partialDiskCacheProducer = mProducerFactory.newPartialDiskCacheProducer(inputProducer);
        cacheWriteProducer = mProducerFactory.newDiskCacheWriteProducer(partialDiskCacheProducer);
    } else {
        cacheWriteProducer = mProducerFactory.newDiskCacheWriteProducer(inputProducer);
    }
    DiskCacheReadProducer result = mProducerFactory.newDiskCacheReadProducer(cacheWriteProducer);
    if (FrescoSystrace.isTracing()) {
        FrescoSystrace.endSection();
    }
    return result;
}
Also used : DiskCacheReadProducer(com.facebook.imagepipeline.producers.DiskCacheReadProducer) EncodedImage(com.facebook.imagepipeline.image.EncodedImage)

Aggregations

EncodedImage (com.facebook.imagepipeline.image.EncodedImage)1 DiskCacheReadProducer (com.facebook.imagepipeline.producers.DiskCacheReadProducer)1