Class SizeConfigStrategy
- java.lang.Object
-
- com.bumptech.glide.load.engine.bitmap_recycle.SizeConfigStrategy
-
@RequiresApi(19) public class SizeConfigStrategy extends java.lang.ObjectKeysBitmapsusing bothBitmap.getAllocationByteCount()and theBitmap.Configreturned fromBitmap.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 ofBitmapswith a matching number of bytes per pixel.
-
-
Constructor Summary
Constructors Constructor Description SizeConfigStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description android.graphics.Bitmapget(int width, int height, android.graphics.Bitmap.Config config)intgetSize(android.graphics.Bitmap bitmap)java.lang.StringlogBitmap(int width, int height, android.graphics.Bitmap.Config config)java.lang.StringlogBitmap(android.graphics.Bitmap bitmap)voidput(android.graphics.Bitmap bitmap)android.graphics.BitmapremoveLast()java.lang.StringtoString()
-
-
-
Method Detail
-
put
public void put(android.graphics.Bitmap bitmap)
-
get
@Nullable public android.graphics.Bitmap get(int width, int height, android.graphics.Bitmap.Config config)
-
removeLast
@Nullable public android.graphics.Bitmap removeLast()
-
logBitmap
public java.lang.String logBitmap(android.graphics.Bitmap bitmap)
-
logBitmap
public java.lang.String logBitmap(int width, int height, android.graphics.Bitmap.Config config)
-
getSize
public int getSize(android.graphics.Bitmap bitmap)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-