private Resource<Bitmap> getTransformedFrame(Bitmap currentFrame, Transformation<Bitmap> transformation,
            GifDrawable drawable) {
        // TODO: what if current frame is null?
        Resource<Bitmap> bitmapResource = factory.buildFrameResource(currentFrame, bitmapPool);
        Resource<Bitmap> transformedResource = transformation.transform(bitmapResource,
                drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
        if (!bitmapResource.equals(transformedResource)) {
            bitmapResource.recycle();
        }
        return transformedResource;
    }
An {@link ResourceEncoder} that can write
{@link GifDrawable} to cache.
core/src/main/java/com/bumptech/glide/load/resource/gif/GifResourceEncoder.java