SizeConfigStrategy

open class SizeConfigStrategy : LruPoolStrategy

Keys Bitmaps using both getAllocationByteCount and the android.graphics.Bitmap.Config returned from 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.

Functions

Link copied to clipboard
open fun get(    width: Int,     height: Int,     config: Config): Bitmap
Link copied to clipboard
open fun getSize(bitmap: Bitmap): Int
Link copied to clipboard
open fun logBitmap(bitmap: Bitmap): String
open fun logBitmap(    width: Int,     height: Int,     config: Config): String
Link copied to clipboard
open fun put(bitmap: Bitmap)
Link copied to clipboard
open fun removeLast(): Bitmap
Link copied to clipboard
open fun toString(): String