kms: Make sure to re-render after finished animation
This commit is contained in:
parent
6439b3a43c
commit
2bc9f94255
1 changed files with 16 additions and 5 deletions
|
|
@ -141,6 +141,7 @@ pub struct Surface {
|
||||||
scheduled: bool,
|
scheduled: bool,
|
||||||
pending: bool,
|
pending: bool,
|
||||||
dirty: bool,
|
dirty: bool,
|
||||||
|
last_animation_state: bool,
|
||||||
render_timer_token: Option<RegistrationToken>,
|
render_timer_token: Option<RegistrationToken>,
|
||||||
fps: Fps,
|
fps: Fps,
|
||||||
feedback: HashMap<DrmNode, SurfaceDmabufFeedback>,
|
feedback: HashMap<DrmNode, SurfaceDmabufFeedback>,
|
||||||
|
|
@ -505,11 +506,20 @@ impl State {
|
||||||
}
|
}
|
||||||
|
|
||||||
surface.pending = false;
|
surface.pending = false;
|
||||||
(surface.dirty
|
let animations_going =
|
||||||
|| data.state.common.shell.animations_going())
|
data.state.common.shell.animations_going();
|
||||||
.then(|| {
|
let animation_diff = std::mem::replace(
|
||||||
(surface.output.clone(), surface.fps.avg_rendertime(5))
|
&mut surface.last_animation_state,
|
||||||
})
|
animations_going,
|
||||||
|
) != animations_going;
|
||||||
|
(surface.dirty || animations_going || animation_diff).then(
|
||||||
|
|| {
|
||||||
|
(
|
||||||
|
surface.output.clone(),
|
||||||
|
surface.fps.avg_rendertime(5),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Some(Err(err)) => {
|
Some(Err(err)) => {
|
||||||
warn!(?err, "Failed to submit frame.");
|
warn!(?err, "Failed to submit frame.");
|
||||||
|
|
@ -916,6 +926,7 @@ impl Device {
|
||||||
scheduled: false,
|
scheduled: false,
|
||||||
pending: false,
|
pending: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
|
last_animation_state: false,
|
||||||
render_timer_token: None,
|
render_timer_token: None,
|
||||||
fps: Fps::new(renderer.as_mut()),
|
fps: Fps::new(renderer.as_mut()),
|
||||||
feedback: HashMap::new(),
|
feedback: HashMap::new(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue