summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2020-11-27 18:16:33 +0300
committerMarge Bot <marge-bot@gnome.org>2021-02-05 17:05:19 +0000
commit01b30ff9e4406eb2c48af3f145e08990e3dcaa55 (patch)
treee7e7733caa53fc0119879ff4e5a2e1ae9687ab66
parented93a11de68c1ed475ded43f968c3ff6530736d4 (diff)
downloadmutter-01b30ff9e4406eb2c48af3f145e08990e3dcaa55.tar.gz
clutter/frame-clock: Comment presentation time skip
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1707>
-rw-r--r--clutter/clutter/clutter-frame-clock.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/clutter/clutter/clutter-frame-clock.c b/clutter/clutter/clutter-frame-clock.c
index 6a32ea3d7..2f617d0a5 100644
--- a/clutter/clutter/clutter-frame-clock.c
+++ b/clutter/clutter/clutter-frame-clock.c
@@ -280,7 +280,20 @@ calculate_next_update_time_us (ClutterFrameClock *frame_clock,
next_presentation_time_us = logical_clock_phase_us + hw_clock_offset_us;
}
- /* Skip one interval if we got an early presented event. */
+ /*
+ * Skip one interval if we got an early presented event.
+ *
+ * last frame this was last_presentation_time
+ * / frame_clock->next_presentation_time_us
+ * / /
+ * |---|-o-----|-x----->
+ * | \
+ * \ next_presentation_time_us is thus right after the last one
+ * but got an unexpected early presentation
+ * \_/
+ * time_since_last_next_presentation_time_us
+ *
+ */
last_next_presentation_time_us = frame_clock->next_presentation_time_us;
time_since_last_next_presentation_time_us =
next_presentation_time_us - last_next_presentation_time_us;