public class SizeConfigStrategy extends Object
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 void put(Bitmap bitmap)
@Nullable public Bitmap get(int width, int height, Bitmap.Config config)
public String logBitmap(int width, int height, Bitmap.Config config)
public int getSize(Bitmap bitmap)