class Tessell::Render::DrawList

Defined in:

tessell/render/draw_list.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def [](index : Int) : DrawCmd #

逻辑视图:按下标读取(越界抛出 IndexError);物理槽位内的陈旧数据不可见。


[View source]
def batch_count : Int32 #

[View source]
def build_batches : Array(Batch) #

兼容接口:返回新数组(分配)。热路径请用 build_batches_into。


[View source]
def build_batches_into(sink : Array(Batch)) : Int32 #

零分配热路径:将批区间写入 sink(复用容量),返回批数。逻辑大小为返回值。


[View source]
def capacity : Int32 #

物理槽位数(= 自控容量):只增不减,clear 不缩减。


[View source]
def clear : Nil #

逻辑清零;底层容量保留(复用缓冲,不释放)。


[View source]
def push(cmd : DrawCmd) : Nil #

[View source]
def reserve(n : Int32) : Nil #

容量提示:物理槽位不足 n 时补足到 n(槽位内容为零值占位, 逻辑上不可见——push 会原位覆写);已有 n 个槽位则直接返回。


[View source]
def reuse_stats : NamedTuple(capacity: Int32, size: Int32, physical: Int32) #

capacity 前后对比用(复用证据)。


[View source]
def size : Int32 #

[View source]
def text_commands : Array(DrawCmd) #

文本命令只读视图(issue #21):宿主/golden 断言文本内容用。 返回新数组(分配)——宿主侧便利接口,非零分配热路径。


[View source]