Skip to main content

frame_step

Function frame_step 

Source
pub fn frame_step<W: WindowBackend>(
    window: &mut W,
    tree: &mut UiTree,
    host: &mut dyn Host,
    events: &[RawEvent],
    dt: Duration,
) -> Result<FrameStats, String>
Expand description

消化一批“已到手“的事件并推进一帧:不阻塞、不计时。

覆盖:事件消化 → 命令/idle → 动画推进 → 重排 → 主题 → after_frame → render → after_present。

  • dt:上一帧到本帧的时间步,由调用方提供(桌面用 Instant,wasm 用 rAF 时间戳)。
  • close_requested:以前 RawEvent::Close 会直接 return,现在改成标记,由调用方决定是否停止。
  • 首帧日志与 profile 统计不进来,它们属于调用方的职责。