com.bumptech.glide.load.engine.bitmap_recycle
Class SizeConfigStrategy
java.lang.Object
com.bumptech.glide.load.engine.bitmap_recycle.SizeConfigStrategy
public class SizeConfigStrategy
- extends Object
Keys Bitmaps
using both Bitmap.getAllocationByteCount()
and
the Bitmap.Config
returned from Bitmap.getConfig()
.
Using both the config and the byte size allows us to safely re-use a greater variety of
Bitmaps
, which increases the hit rate of the pool and therefore the performance
of applications. This class works around #301 by only allowing re-use of Bitmaps
with a matching number of bytes per pixel.
SizeConfigStrategy
public SizeConfigStrategy()
put
public void put(Bitmap bitmap)
get
public Bitmap get(int width,
int height,
Bitmap.Config config)
removeLast
public Bitmap removeLast()
logBitmap
public String logBitmap(Bitmap bitmap)
logBitmap
public String logBitmap(int width,
int height,
Bitmap.Config config)
getSize
public int getSize(Bitmap bitmap)
toString
public String toString()
- Overrides:
toString
in class Object