summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2016-02-05 13:58:51 -0500
committerRay Strode <rstrode@redhat.com>2016-02-08 17:01:58 -0500
commit50099c4c10c9311c6d0deb978d21637c9437c027 (patch)
treeb0b938d6ab790f1bdfaf674da98c325f400fe1de
parent55eef2deb35c2a6578527a0db98b1a96f0a79bb9 (diff)
downloadmutter-50099c4c10c9311c6d0deb978d21637c9437c027.tar.gz
wayland: use glib function for fetching timestamp
The code currently implements a function, get_time, that fetches a timestamp. That duplicates code already in glib, and the glib implementation is better, anyway, since it doesn't skew backward when the system clock is changed. This commit changes the code to use g_get_monotonic_time and drop the get_time function. https://bugzilla.gnome.org/show_bug.cgi?id=761613
-rw-r--r--src/wayland/meta-wayland.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index d51e8b558..523fbceb7 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -48,14 +48,6 @@ meta_wayland_compositor_get_default (void)
return &_meta_wayland_compositor;
}
-static guint32
-get_time (void)
-{
- struct timeval tv;
- gettimeofday (&tv, NULL);
- return tv.tv_sec * 1000 + tv.tv_usec / 1000;
-}
-
typedef struct
{
GSource source;
@@ -186,7 +178,7 @@ meta_wayland_compositor_paint_finished (MetaWaylandCompositor *compositor)
MetaWaylandFrameCallback *callback =
wl_container_of (compositor->frame_callbacks.next, callback, link);
- wl_callback_send_done (callback->resource, get_time ());
+ wl_callback_send_done (callback->resource, g_get_monotonic_time () / 1000);
wl_resource_destroy (callback->resource);
}
}