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.
This commit is contained in:
Derek Foreman 2016-12-13 13:53:18 -06:00
parent f5f9bd5338
commit 0493abf457
1 changed files with 8 additions and 2 deletions

View File

@ -64,6 +64,8 @@ struct _E_Pixmap
#ifdef HAVE_WAYLAND #ifdef HAVE_WAYLAND
double wayland_time_base;
static void static void
_e_pixmap_cb_deferred_buffer_destroy(struct wl_listener *listener, void *data EINA_UNUSED) _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 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 = _e_pixmap_new(type);
cp->win = id; cp->win = id;
eina_hash_add(pixmaps[type], &id, cp); eina_hash_add(pixmaps[type], &id, cp);
@ -798,7 +803,8 @@ e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache)
cd->frames = NULL; cd->frames = NULL;
EINA_LIST_FREE(free_list, cb) 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); wl_resource_destroy(cb);
} }
} }