@Override
    public Resource<T> transform(Resource<T> resource, int outWidth, int outHeight) {
        Resource<T> previous = resource;

        for (Transformation<T> transformation : transformations) {
            Resource<T> transformed = transformation.transform(previous, outWidth, outHeight);
            if (previous != null && !previous.equals(resource) && !previous.equals(transformed)) {
                previous.recycle();
            }
            previous = transformed;
        }
        return previous;
    }
A transformation that applies one or more transformations in iteration order to a resource.

@param <T> The type of {@link Resource} that will be transformed.
core/src/main/java/com/bumptech/glide/load/MultiTransformation.java