iTime now starts at 0
This commit is contained in:
parent
44ba0468d9
commit
c3c39a77cd
1 changed files with 7 additions and 1 deletions
|
|
@ -157,10 +157,16 @@ void egl_init_surface(struct client_state *state, struct surface *surface) {
|
||||||
|
|
||||||
static const struct wl_callback_listener wl_surface_frame_listener;
|
static const struct wl_callback_listener wl_surface_frame_listener;
|
||||||
|
|
||||||
|
bool first_frame_done = false;
|
||||||
|
uint32_t time_start;
|
||||||
static void
|
static void
|
||||||
wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) {
|
wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) {
|
||||||
|
if (!first_frame_done) {
|
||||||
|
first_frame_done = true;
|
||||||
|
time_start = time;
|
||||||
|
}
|
||||||
struct surface *surface = data;
|
struct surface *surface = data;
|
||||||
surface->time = time;
|
surface->time = time - time_start;
|
||||||
|
|
||||||
/* Destroy this callback */
|
/* Destroy this callback */
|
||||||
wl_callback_destroy(cb);
|
wl_callback_destroy(cb);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue