clutter/frame-clock: Clamp next_update_time to the current time
Calculating a timestamp from the past distorts the dispatch lateness calculation, leading to an inflated max_render_time, which again increases the likelyhood of next_update_time being in the past. Fixes 99850f46459 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2819>
This commit is contained in:
parent
be649bdad2
commit
678bc69e72
@ -573,6 +573,8 @@ calculate_next_update_time_us (ClutterFrameClock *frame_clock,
|
|||||||
next_presentation_time_us += refresh_interval_us;
|
next_presentation_time_us += refresh_interval_us;
|
||||||
|
|
||||||
next_update_time_us = next_presentation_time_us - max_render_time_allowed_us;
|
next_update_time_us = next_presentation_time_us - max_render_time_allowed_us;
|
||||||
|
if (next_update_time_us < now_us)
|
||||||
|
next_update_time_us = now_us;
|
||||||
|
|
||||||
*out_next_update_time_us = next_update_time_us;
|
*out_next_update_time_us = next_update_time_us;
|
||||||
*out_next_presentation_time_us = next_presentation_time_us;
|
*out_next_presentation_time_us = next_presentation_time_us;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user