blob: 7d2b67f26f51038c5ad0822a504e62f245066c9d [file] [log] [blame]
package com.bumptech.glide.load.resource.gif;
import com.bumptech.glide.load.resource.drawable.DrawableResource;
import com.bumptech.glide.util.Util;
/**
* A resource wrapping an {@link com.bumptech.glide.load.resource.gif.GifDrawable}.
*/
public class GifDrawableResource extends DrawableResource<GifDrawable> {
public GifDrawableResource(GifDrawable drawable) {
super(drawable);
}
@Override
public int getSize() {
return drawable.getData().length + Util.getBitmapByteSize(drawable.getFirstFrame());
}
@Override
public void recycle() {
drawable.stop();
drawable.recycle();
}
}