LuckyPictureCache class final
按整数段缓存录制结果;例如 cache.picture(0, record)。
Constructors
- LuckyPictureCache({LuckyCacheMode mode = LuckyCacheMode.picture, int maxRasterSide = kLuckyDefaultMaxRasterSide, int maxRasterBytes = kLuckyDefaultMaxRasterBytes})
-
创建缓存;位图超过
maxRasterSide或共享预算时由调用方回退到 Picture。
Properties
- debugRasterBytes → int
-
当前缓存位图的 RGBA 字节总数,不包含引擎或驱动的附加内存。
no setter
- debugRecordCount → int
-
累计录制次数,失效不会清零。
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxRasterBytes ↔ int
-
实验性(可能调整):本缓存允许的共享字节上限,0 禁用 raster。
getter/setter pair
- maxRasterSide ↔ int
-
位图最大设备像素边长。
getter/setter pair
- mode ↔ LuckyCacheMode
-
缓存模式。
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - 释放全部缓存;可重复调用。
-
invalidate(
int id) → void - 失效单个段并释放原生资源。
-
invalidateAll(
) → void - 失效全部段并释放原生资源。
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
picture(
int id, void record(Canvas canvas)) → Picture -
返回
id对应显示列表,首次调用record录制。 -
raster(
int id, Size logicalSize, double devicePixelRatio, void record(Canvas canvas), {Offset origin = ui.Offset.zero}) → Image? - 返回物理像素位图;picture 模式、零尺寸或边长/共享预算超限时返回 null。
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited