compositor-wayland: Call wlsc_compositor_finish_frame from frame callback

dev
Kristian Høgsberg 14 years ago
parent 4203df1fd5
commit 3ada7ec83a
  1. 15
      compositor/compositor-wayland.c

@ -27,7 +27,6 @@
#include <string.h> #include <string.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h>
#include "wayland-client.h" #include "wayland-client.h"
@ -169,12 +168,19 @@ wayland_compositor_init_egl(struct wayland_compositor *c)
return 0; return 0;
} }
static void
frame_callback(void *data, uint32_t time)
{
struct wayland_compositor *c = (struct wayland_compositor *) data;
wlsc_compositor_finish_frame(&c->base, time);
}
static void static void
wayland_compositor_present(struct wlsc_compositor *base) wayland_compositor_present(struct wlsc_compositor *base)
{ {
struct wayland_compositor *c = (struct wayland_compositor *) base; struct wayland_compositor *c = (struct wayland_compositor *) base;
struct wayland_output *output; struct wayland_output *output;
struct timeval tv;
uint32_t msec; uint32_t msec;
glFlush(); glFlush();
@ -193,10 +199,7 @@ wayland_compositor_present(struct wlsc_compositor *base)
output->base.width, output->base.height); output->base.width, output->base.height);
} }
wl_display_frame_callback(c->parent.display, frame_callback, c);
gettimeofday(&tv, NULL);
msec = tv.tv_sec * 1000 + tv.tv_usec / 1000;
wlsc_compositor_finish_frame(&c->base, msec);
} }
static int static int

Loading…
Cancel
Save