blob: 91b211e23e573b66523965df8165613b19f38d6f [file] [log] [blame]
package com.bumptech.glide.load.resource.bitmap;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.drawable.DrawableResource;
import com.bumptech.glide.util.Util;
/**
* A resource wrapper for {@link com.bumptech.glide.load.resource.bitmap.GlideBitmapDrawable}.
*/
public class GlideBitmapDrawableResource extends DrawableResource<GlideBitmapDrawable> {
private final BitmapPool bitmapPool;
public GlideBitmapDrawableResource(GlideBitmapDrawable drawable, BitmapPool bitmapPool) {
super(drawable);
this.bitmapPool = bitmapPool;
}
@Override
public int getSize() {
return Util.getBitmapByteSize(drawable.getBitmap());
}
@Override
public void recycle() {
bitmapPool.put(drawable.getBitmap());
}
}