gtk2/gdk
Alexander Larsson 9ef3e70040 frame-clock: New approach in smoothing frame clock
In commit c6901a8b, the frame clock reported time was changed from
simply reporting the time we ran the frame clock cycle to reporting a
smoothed value that increased by the frame interval each time it was
called.

However, this change caused some problems, such as:
 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1415
 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1416
 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1482

I think a lot of this is caused by the fact that we just overwrote the
old frame time with the smoothed, monotonous timestamp, breaking
some things that relied on knowing the actual time something happened.

This is a new approach to doing the smoothing that is more explicit.
The "frame_time" we store is the actual time we ran the update cycle,
and then we separately compute and store the derived smoothed time and
its period, allowing us to easily return a smoothed time at any time
by rounding the time difference to an integer number of frames.

The initial frame_time can be somewhat arbitrary, as it depends on the
first cycle which is not driven by the frame clock. But follow-up
cycles are typically tied to the the compositor sending the drawn
signal. It may happen that the initial frame is exactly in the middle
between two frames where jitter causes us to randomly round in
different directions when rounding to nearest frame. To fix this we
additionally do a quadratic convergence towards the "real" time,
during presentation driven clock cycles (i.e. when the frame times are
small).
2020-05-28 15:13:07 +02:00
..
broadway
quartz
resources/glsl
wayland
win32
x11
COPYING
default_cursor.png
fallback-c89.c
filetransferportal.c
filetransferportalprivate.h
gdk-autocleanup.h
gdk-private.h
gdk.c
gdk.h
gdkapplaunchcontext.c
gdkapplaunchcontext.h
gdkapplaunchcontextprivate.h
gdkcairo.c
gdkcairo.h
gdkcairocontext.c
gdkcairocontext.h
gdkcairocontextprivate.h
gdkclipboard.c
gdkclipboard.h
gdkclipboardprivate.h
gdkconfig.h.meson
gdkconfig.h.win32
gdkconfig.h.win32_vulkan
gdkconstructor.h
gdkcontentdeserializer.c
gdkcontentdeserializer.h
gdkcontentformats.c
gdkcontentformats.h
gdkcontentformatsprivate.h
gdkcontentprovider.c
gdkcontentprovider.h
gdkcontentproviderimpl.c
gdkcontentproviderimpl.h
gdkcontentproviderprivate.h
gdkcontentserializer.c
gdkcontentserializer.h
gdkcursor.c
gdkcursor.h
gdkcursorprivate.h
gdkdevice.c
gdkdevice.h
gdkdevicepad.c
gdkdevicepad.h
gdkdevicepadprivate.h
gdkdeviceprivate.h
gdkdevicetool.c
gdkdevicetool.h
gdkdevicetoolprivate.h
gdkdisplay.c
gdkdisplay.h
gdkdisplaymanager.c
gdkdisplaymanager.h
gdkdisplaymanagerprivate.h
gdkdisplayprivate.h
gdkdrag.c
gdkdrag.h
gdkdragprivate.h
gdkdragsurface.c
gdkdragsurface.h
gdkdragsurfaceprivate.h
gdkdrawcontext.c
gdkdrawcontext.h
gdkdrawcontextprivate.h
gdkdrop.c
gdkdrop.h
gdkdropprivate.h
gdkenumtypes.c.template
gdkenumtypes.h.template
gdkevents.c
gdkevents.h
gdkeventsprivate.h
gdkframeclock.c frame-clock: New approach in smoothing frame clock 2020-05-28 15:13:07 +02:00
gdkframeclock.h
gdkframeclockidle.c frame-clock: New approach in smoothing frame clock 2020-05-28 15:13:07 +02:00
gdkframeclockidleprivate.h
gdkframeclockprivate.h frame-clock: New approach in smoothing frame clock 2020-05-28 15:13:07 +02:00
gdkframetimings.c
gdkframetimings.h
gdkgl.c
gdkglcontext.c
gdkglcontext.h
gdkglcontextprivate.h
gdkglobals.c
gdkgltexture.c
gdkgltexture.h
gdkgltextureprivate.h
gdkinternals.h
gdkintl.h
gdkkeynames.c
gdkkeys.c
gdkkeys.h
gdkkeysprivate.h
gdkkeysyms-update.pl
gdkkeysyms.h
gdkkeyuni.c
gdkmarshalers.list
gdkmemorytexture.c
gdkmemorytexture.h
gdkmemorytextureprivate.h
gdkmonitor.c
gdkmonitor.h
gdkmonitorprivate.h
gdkpaintable.c
gdkpaintable.h
gdkpango.c
gdkpango.h
gdkpipeiostream.c
gdkpipeiostreamprivate.h
gdkpixbuf-drawable.c
gdkpixbuf.h
gdkpopup.c
gdkpopup.h
gdkpopuplayout.c
gdkpopuplayout.h
gdkpopupprivate.h
gdkprofiler.c
gdkprofilerprivate.h
gdkrectangle.c
gdkrectangle.h
gdkrgba.c
gdkrgba.h
gdkrgbaprivate.h
gdkseat.c
gdkseat.h
gdkseatdefault.c
gdkseatdefaultprivate.h
gdkseatprivate.h
gdksnapshot.c
gdksnapshot.h
gdksnapshotprivate.h
gdksurface.c
gdksurface.h
gdksurfaceprivate.h
gdktexture.c
gdktexture.h
gdktextureprivate.h
gdktoplevel.c
gdktoplevel.h
gdktoplevellayout.c
gdktoplevellayout.h
gdktoplevelprivate.h
gdktypes.h
gdkversionmacros.h.in
gdkvulkancontext.c
gdkvulkancontext.h
gdkvulkancontextprivate.h
gen-gdk-gresources-xml.py
gen-keyname-table.pl
keyname-table.h
keynames-translate.txt
keynames.txt
meson.build