summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2021-02-04 10:52:08 +0300
committerMarge Bot <marge-bot@gnome.org>2021-02-05 17:05:19 +0000
commitbc7c56fa74537deb41507c606f89b31aac86d8f2 (patch)
treef14132b5cf88e9dedb40c205f7ba4ec0eebeb368
parent8bdad733ca7242ee4ad98a965acbc187af6ca592 (diff)
downloadmutter-bc7c56fa74537deb41507c606f89b31aac86d8f2.tar.gz
clutter/frame-clock: Always update last presentation time
Last presentation time is mainly used to make sure predicted presentation time is aligned with display refreshes. Even if it went back in time, there will be no issue as next presentation time takes current time into account. Synthetic presentation time is not exactly aligned with display refreshes, so using it would only result in inconsistent animations. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
-rw-r--r--clutter/clutter/clutter-frame-clock.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/clutter/clutter/clutter-frame-clock.c b/clutter/clutter/clutter-frame-clock.c
index d353dbd43..cd551091c 100644
--- a/clutter/clutter/clutter-frame-clock.c
+++ b/clutter/clutter/clutter-frame-clock.c
@@ -181,21 +181,7 @@ void
clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
ClutterFrameInfo *frame_info)
{
- int64_t presentation_time_us = frame_info->presentation_time;
-
- if (presentation_time_us > frame_clock->last_presentation_time_us ||
- ((presentation_time_us - frame_clock->last_presentation_time_us) >
- INT64_MAX / 2))
- {
- frame_clock->last_presentation_time_us = presentation_time_us;
- }
- else
- {
- g_warning_once ("Bogus presentation time %" G_GINT64_FORMAT
- " travelled back in time, using current time.",
- presentation_time_us);
- frame_clock->last_presentation_time_us = g_get_monotonic_time ();
- }
+ frame_clock->last_presentation_time_us = frame_info->presentation_time;
if (frame_info->refresh_rate > 1)
frame_clock->refresh_rate = frame_info->refresh_rate;