public class CachingPolicy
extends java.lang.Object
CacheManagingDrawTask
提供缓存相关的策略设置: 限定符和类型 | 字段和说明 |
---|---|
int |
bitsPerPixelOfCache
缓存bitmap的格式, ARGB_4444 = 16 ARGB_8888 = 32
use BMP_BPP_ARGB_4444 or BMP_BPP_ARGB_8888
Note: as of
Build.VERSION_CODES.KITKAT ,
any bitmap created with this configuration will be created
using #ARGB_8888 instead. |
static int |
BMP_BPP_ARGB_4444 |
static int |
BMP_BPP_ARGB_8888 |
static int |
CACHE_PERIOD_AUTO |
static int |
CACHE_PERIOD_NOT_RECYCLE |
float |
forceRecyleThreshold
内存占用大小超过总容量一定比例值(forceRecyleThreshold值)的缓存,在回收时进行主动回收,忽略CACHE_PERIOD_NOT_RECYCLE
|
float |
maxCachePoolSizeFactorPercentage
0.0 ~ 1.0, 超过0.5的话有OOM风险
|
int |
maxTimesOfReusableFinds |
int |
maxTimesOfStrictReusableFinds |
long |
periodOfRecycle
回收周期
|
static CachingPolicy |
POLICY_DEFAULT |
static CachingPolicy |
POLICY_GREEDY |
static CachingPolicy |
POLICY_LAZY |
int |
reusableOffsetPixel |
构造器和说明 |
---|
CachingPolicy(int bitsPerPixelOfCache,
float maxCachePoolSizeFactorPercentage,
long periodOfRecycle,
int reusableOffsetPixel,
float forceRecyleThreshold) |
public static final int BMP_BPP_ARGB_4444
public static final int BMP_BPP_ARGB_8888
public static final int CACHE_PERIOD_AUTO
public static final int CACHE_PERIOD_NOT_RECYCLE
public static final CachingPolicy POLICY_LAZY
public static final CachingPolicy POLICY_GREEDY
public static final CachingPolicy POLICY_DEFAULT
public int bitsPerPixelOfCache
Build.VERSION_CODES.KITKAT
,
any bitmap created with this configuration will be created
using #ARGB_8888
instead.public float maxCachePoolSizeFactorPercentage
public long periodOfRecycle
0: 默认
,
-1: 不回收
public float forceRecyleThreshold
public int reusableOffsetPixel
public int maxTimesOfStrictReusableFinds
public int maxTimesOfReusableFinds