fn on_frame_presented(
        &self,
        actual_presentation_time: zx::Time,
        presented_infos: Vec<PresentedInfo>,
    ) {
        // Update per-present stats for all squashed and shown presents from the current frame.
        let previous_frames = &mut self.previous_frames.borrow_mut();
        let latency_stats = &mut self.latency_stats.borrow_mut();
        for PresentedInfo { actual_latch_point, .. } in presented_infos.iter() {
            let frame = previous_frames.pop_front().unwrap();
            let mut count = latency_stats
                .entry(frame.latch_offset)
                .or_insert(FrameCount { total: 0, missed_latch_points: 0 });
            count.total += 1;
            if actual_latch_point > &(frame.expected_latch_point + self.half_frame_time.get()) {
                count.missed_latch_points += 1;
            }
        }

        self.frame_stats_collector.on_frame_presented(actual_presentation_time, presented_infos)
    }
// on_frame_presented() tells us how the previous set of presents worked out, so here we can
// track how successful our frame scheduling is.
on_frame_presented() tells us how the previous set of presents worked out, so here we can
track how successful our frame scheduling is.
on_frame_presented () tells us how the previous set of presents worked out so here we can track how successful our frame scheduling is .
fn on_frame_presented(
        &self,
        actual_presentation_time: zx::Time,
        presented_infos: Vec<PresentedInfo>,
    ) {
        // Update per-present stats for all squashed and shown presents from the current frame.
        let previous_frames = &mut self.previous_frames.borrow_mut();
        let latency_stats = &mut self.latency_stats.borrow_mut();
        for PresentedInfo { actual_latch_point, .. } in presented_infos.iter() {
            let frame = previous_frames.pop_front().unwrap();
            let mut count = latency_stats
                .entry(frame.latch_offset)
                .or_insert(FrameCount { total: 0, missed_latch_points: 0 });
            count.total += 1;
            if actual_latch_point > &(frame.expected_latch_point + self.half_frame_time.get()) {
                count.missed_latch_points += 1;
            }
        }
        self.frame_stats_collector.on_frame_presented(actual_presentation_time, presented_infos)
    }
fn on_frame_presented ( & self , actual_presentation_time : zx :: Time , presented_infos : Vec < PresentedInfo > , ) { // Update per-present stats for all squashed and shown presents from the current frame. let previous_frames = & mut self . previous_frames . borrow_mut ( ) ; let latency_stats = & mut self . latency_stats . borrow_mut ( ) ; for PresentedInfo { actual_latch_point , .. } in presented_infos . iter ( ) { let frame = previous_frames . pop_front ( ) . unwrap ( ) ; let mut count = latency_stats . entry ( frame . latch_offset ) . or_insert ( FrameCount { total : 0 , missed_latch_points : 0 } ) ; count . total += 1 ; if actual_latch_point > & ( frame . expected_latch_point + self . half_frame_time . get ( ) ) { count . missed_latch_points += 1 ; } } self . frame_stats_collector . on_frame_presented ( actual_presentation_time , presented_infos ) }
on_frame_presented() tells us how the previous set of presents worked out, so here we can
track how successful our frame scheduling is.
on_frame_presented () tells us how the previous set of presents worked out so here we can track how successful our frame scheduling is .
&self
actual_presentation_time
zx::Time
presented_infos
Vec<PresentedInfo>
&self
actual_presentation_time
zx::Time
presented_infos
Vec<PresentedInfo>