forge
Explore
Log in

Don't you dare go Hollow

niri: Rename presentation_time to target_presentation_time

Browse files at this commit

c082e2a618464f4acd30388c90f347f6d4a4effaIvan MolodetskikhParent: 42bb79d
Makes it clearer that this is a prediction.
src/niri.rsmodified+9 -9
@@ -1564,10 +1564,10 @@ impl Niri {
1564 };1564 };
1565 1565
1566 let state = self.output_state.get_mut(output).unwrap();1566 let state = self.output_state.get_mut(output).unwrap();
1567- let presentation_time = state.frame_clock.next_presentation_time();1567+ let target_presentation_time = state.frame_clock.next_presentation_time();
1568 1568
1569 // Update from the config and advance the animations.1569 // Update from the config and advance the animations.
1570- self.layout.advance_animations(presentation_time);1570+ self.layout.advance_animations(target_presentation_time);
1571 state.unfinished_animations_remain = self1571 state.unfinished_animations_remain = self
1572 .layout1572 .layout
1573 .monitor_for_output(output)1573 .monitor_for_output(output)
@@ -1583,7 +1583,7 @@ impl Niri {
1583 let elements = self.render(renderer, output, true);1583 let elements = self.render(renderer, output, true);
1584 1584
1585 // Hand it over to the backend.1585 // Hand it over to the backend.
1586- let res = backend.render(self, output, &elements, presentation_time);1586+ let res = backend.render(self, output, &elements, target_presentation_time);
1587 1587
1588 // Update the lock render state on successful render.1588 // Update the lock render state on successful render.
1589 let is_locked = self.is_locked();1589 let is_locked = self.is_locked();
@@ -1645,7 +1645,7 @@ impl Niri {
1645 let renderer = backend1645 let renderer = backend
1646 .renderer()1646 .renderer()
1647 .expect("renderer must not have disappeared");1647 .expect("renderer must not have disappeared");
1648- self.send_for_screen_cast(renderer, output, &elements, presentation_time);1648+ self.send_for_screen_cast(renderer, output, &elements, target_presentation_time);
1649 }1649 }
1650 }1650 }
1651 1651
@@ -1929,7 +1929,7 @@ impl Niri {
1929 renderer: &mut GlesRenderer,1929 renderer: &mut GlesRenderer,
1930 output: &Output,1930 output: &Output,
1931 elements: &[OutputRenderElements<GlesRenderer>],1931 elements: &[OutputRenderElements<GlesRenderer>],
1932- presentation_time: Duration,1932+ target_presentation_time: Duration,
1933 ) {1933 ) {
1934 let _span = tracy_client::span!("Niri::send_for_screen_cast");1934 let _span = tracy_client::span!("Niri::send_for_screen_cast");
1935 1935
@@ -1947,11 +1947,11 @@ impl Niri {
1947 1947
1948 let last = cast.last_frame_time;1948 let last = cast.last_frame_time;
1949 let min = cast.min_time_between_frames.get();1949 let min = cast.min_time_between_frames.get();
1950- if !last.is_zero() && presentation_time - last < min {1950+ if !last.is_zero() && target_presentation_time - last < min {
1951 trace!(1951 trace!(
1952 "skipping frame because it is too soon \1952 "skipping frame because it is too soon \
1953- last={last:?} now={presentation_time:?} diff={:?} < min={min:?}",1953+ last={last:?} now={target_presentation_time:?} diff={:?} < min={min:?}",
1954- presentation_time - last,1954+ target_presentation_time - last,
1955 );1955 );
1956 continue;1956 continue;
1957 }1957 }
@@ -1981,7 +1981,7 @@ impl Niri {
1981 *chunk.stride_mut() = maxsize as i32 / size.h;1981 *chunk.stride_mut() = maxsize as i32 / size.h;
1982 }1982 }
1983 1983
1984- cast.last_frame_time = presentation_time;1984+ cast.last_frame_time = target_presentation_time;
1985 }1985 }
1986 }1986 }
1987 1987