示例#1
0
文件: x11.c 项目: snells/wlc
static bool
page_flip(struct wlc_backend_surface *bsurface)
{
   struct timespec ts;
   wlc_get_time(&ts);
   struct wlc_output *o;
   wlc_output_finish_frame(wl_container_of(bsurface, o, bsurface), &ts);
   return true;
}
示例#2
0
文件: drm.c 项目: UIKit0/wlc
static void
page_flip_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data)
{
    assert(data);
    (void)fd, (void)frame;
    struct wlc_backend_surface *bsurface = data;
    struct drm_surface *dsurface = bsurface->internal;

    uint8_t next = (dsurface->index + 1) % NUM_FBS;
    release_fb(dsurface->surface, &dsurface->fb[next]);
    dsurface->index = next;

    struct timespec ts;
    ts.tv_sec = sec;
    ts.tv_nsec = usec * 1000;

    struct wlc_output *o;
    wlc_output_finish_frame(wl_container_of(bsurface, o, bsurface), &ts);
    dsurface->flipping = false;
}