From 0493abf457331fc604e2aa64eb51448fada09913 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 13 Dec 2016 13:53:18 -0600 Subject: [PATCH] Fix wayland frame callback times ecore_time_unix_get() * 1000 is too big to fit in a uint32, so take the time we instantiate the wayland pixmap hash and use that as a base. --- src/bin/e_pixmap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index f46a994e5..8e072a09d 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -64,6 +64,8 @@ struct _E_Pixmap #ifdef HAVE_WAYLAND +double wayland_time_base; + static void _e_pixmap_cb_deferred_buffer_destroy(struct wl_listener *listener, void *data EINA_UNUSED) { @@ -342,7 +344,10 @@ e_pixmap_new(E_Pixmap_Type type, ...) } } else - pixmaps[type] = eina_hash_int64_new((Eina_Free_Cb)_e_pixmap_free); + { + pixmaps[type] = eina_hash_int64_new((Eina_Free_Cb)_e_pixmap_free); + wayland_time_base = ecore_time_unix_get(); + } cp = _e_pixmap_new(type); cp->win = id; eina_hash_add(pixmaps[type], &id, cp); @@ -798,7 +803,8 @@ e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache) cd->frames = NULL; EINA_LIST_FREE(free_list, cb) { - wl_callback_send_done(cb, ecore_time_unix_get() * 1000); + double t = ecore_time_unix_get() - wayland_time_base; + wl_callback_send_done(cb, t * 1000); wl_resource_destroy(cb); } }