class
Tessell::Render::DrawList
- Tessell::Render::DrawList
- Reference
- Object
Defined in:
tessell/render/draw_list.crConstructors
Instance Method Summary
-
#[](index : Int) : DrawCmd
逻辑视图:按下标读取(越界抛出 IndexError);物理槽位内的陈旧数据不可见。
- #batch_count : Int32
-
#build_batches : Array(Batch)
兼容接口:返回新数组(分配)。热路径请用 build_batches_into。
-
#build_batches_into(sink : Array(Batch)) : Int32
零分配热路径:将批区间写入 sink(复用容量),返回批数。逻辑大小为返回值。
-
#capacity : Int32
物理槽位数(= 自控容量):只增不减,clear 不缩减。
-
#clear : Nil
逻辑清零;底层容量保留(复用缓冲,不释放)。
- #push(cmd : DrawCmd) : Nil
-
#reserve(n : Int32) : Nil
容量提示:物理槽位不足 n 时补足到 n(槽位内容为零值占位, 逻辑上不可见——push 会原位覆写);已有 n 个槽位则直接返回。
-
#reuse_stats : NamedTuple(capacity: Int32, size: Int32, physical: Int32)
capacity 前后对比用(复用证据)。
- #size : Int32
-
#text_commands : Array(DrawCmd)
文本命令只读视图(issue #21):宿主/golden 断言文本内容用。 返回新数组(分配)——宿主侧便利接口,非零分配热路径。
Constructor Detail
Instance Method Detail
零分配热路径:将批区间写入 sink(复用容量),返回批数。逻辑大小为返回值。
文本命令只读视图(issue #21):宿主/golden 断言文本内容用。 返回新数组(分配)——宿主侧便利接口,非零分配热路径。