use of com.facebook.fresco.vito.core.VitoImageRequest in project fresco by facebook.
the class VitoImagePipelineImpl method createImageRequest.
@Override
public VitoImageRequest createImageRequest(Resources resources, ImageSource imageSource, @Nullable ImageOptions options) {
if (options == null) {
options = ImageOptions.defaults();
}
if (!(imageSource instanceof VitoImageSource)) {
throw new IllegalArgumentException("ImageSource not supported: " + imageSource);
}
VitoImageSource vitoImageSource = (VitoImageSource) imageSource;
CacheKey finalImageCacheKey = null;
ImageRequest finalImageRequest = vitoImageSource.maybeExtractFinalImageRequest(mImagePipelineUtils, options);
if (finalImageRequest != null) {
finalImageCacheKey = mImagePipeline.getCacheKey(finalImageRequest, null);
}
return new VitoImageRequest(resources, imageSource, options, finalImageRequest, finalImageCacheKey);
}
use of com.facebook.fresco.vito.core.VitoImageRequest in project fresco by facebook.
the class FrescoController2Impl method obtainExtras.
private static Extras obtainExtras(@Nullable DataSource<CloseableReference<CloseableImage>> dataSource, @Nullable CloseableReference<CloseableImage> image, FrescoDrawable2 drawable) {
Map<String, Object> imageExtras = null;
if (image != null) {
imageExtras = image.get().getExtras();
}
Uri sourceUri = null;
VitoImageRequest vitoImageRequest = drawable.getImageRequest();
if (vitoImageRequest != null) {
if (vitoImageRequest.finalImageRequest != null) {
sourceUri = vitoImageRequest.finalImageRequest.getSourceUri();
}
}
return MiddlewareUtils.obtainExtras(COMPONENT_EXTRAS, SHORTCUT_EXTRAS, dataSource == null ? null : dataSource.getExtras(), drawable.getViewportDimensions(), String.valueOf(drawable.getActualImageScaleType()), drawable.getActualImageFocusPoint(), imageExtras, drawable.getCallerContext(), sourceUri);
}
use of com.facebook.fresco.vito.core.VitoImageRequest in project fresco by facebook.
the class FrescoController2Impl method onRelease.
@Override
public void onRelease(final FrescoDrawable2Impl drawable) {
final VitoImageRequest imageRequest = drawable.getImageRequest();
if (imageRequest != null) {
// Notify listeners
drawable.getInternalListener().onRelease(drawable.getImageId(), imageRequest, obtainExtras(null, null, drawable));
}
drawable.getImagePerfListener().onImageRelease(drawable);
}
Aggregations