1package com.bumptech.glide.load.resource.gif; 2 3import com.bumptech.glide.load.resource.drawable.DrawableResource; 4import com.bumptech.glide.util.Util; 5 6/** 7 * A resource wrapping an {@link com.bumptech.glide.load.resource.gif.GifDrawable}. 8 */ 9public class GifDrawableResource extends DrawableResource<GifDrawable> { 10 public GifDrawableResource(GifDrawable drawable) { 11 super(drawable); 12 } 13 14 @Override 15 public int getSize() { 16 return drawable.getData().length + Util.getBitmapByteSize(drawable.getFirstFrame()); 17 } 18 19 @Override 20 public void recycle() { 21 drawable.stop(); 22 drawable.recycle(); 23 } 24} 25