Search in sources :

Example 1 with DrawableTransformation

use of com.bumptech.glide.load.resource.bitmap.DrawableTransformation in project glide by bumptech.

the class RequestOptions method transform.

@NonNull
private RequestOptions transform(@NonNull Transformation<Bitmap> transformation, boolean isRequired) {
    if (isAutoCloneEnabled) {
        return clone().transform(transformation, isRequired);
    }
    DrawableTransformation drawableTransformation = new DrawableTransformation(transformation, isRequired);
    transform(Bitmap.class, transformation, isRequired);
    transform(Drawable.class, drawableTransformation, isRequired);
    // TODO: remove BitmapDrawable decoder and this transformation.
    // Registering as BitmapDrawable is simply an optimization to avoid some iteration and
    // isAssignableFrom checks when obtaining the transformation later on. It can be removed without
    // affecting the functionality.
    transform(BitmapDrawable.class, drawableTransformation.asBitmapDrawable(), isRequired);
    transform(GifDrawable.class, new GifDrawableTransformation(transformation), isRequired);
    return selfOrThrowIfLocked();
}
Also used : GifDrawableTransformation(com.bumptech.glide.load.resource.gif.GifDrawableTransformation) DrawableTransformation(com.bumptech.glide.load.resource.bitmap.DrawableTransformation) GifDrawableTransformation(com.bumptech.glide.load.resource.gif.GifDrawableTransformation) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)1 DrawableTransformation (com.bumptech.glide.load.resource.bitmap.DrawableTransformation)1 GifDrawableTransformation (com.bumptech.glide.load.resource.gif.GifDrawableTransformation)1