diff --git a/core/src/ui/render_state.rs b/core/src/ui/render_state.rs index 78107b5..822cee8 100644 --- a/core/src/ui/render_state.rs +++ b/core/src/ui/render_state.rs @@ -40,10 +40,8 @@ pub struct UiRenderState { old_root: Option, resized: bool, - /// Widgets whose `draw` call is on the stack now. A reentrant draw would - /// create two retained primitive sets with one owner, so it is rejected; - /// completed draws are removed immediately and are instead tracked by - /// consuming their outstanding dirty mark. + /// Widgets whose `draw` call is currently on the stack. Reentrant draws + /// are invalid because each widget owns exactly one retained primitive set. draw_started: HashSet, /// Widgets which asked from inside `draw` to be drawn on the following /// frame. Kept separate from `Widgets::needs_redraw` until `update_at` @@ -266,11 +264,9 @@ impl UiRenderState { "a previous frame left {} widget(s) marked as mid-draw", self.draw_started.len(), ); - // Timed unconditionally -- an `Instant::now()` pair is cheap enough - // not to move the `--phone` bench's frame time (checked when this - // was added), and gating it behind the trace toggle would leave - // `iris::frame` with nothing to report the one frame somebody just - // turned tracing on to look at. + // Keep timing independent of the trace toggle so the first traced + // frame has a duration to report. The clock reads do not measurably + // affect the `--phone` benchmark. let layout_start = Instant::now(); let kind = if self.needs_redraw_all(root) { self.redraw_all(root, rsc);