new xrender: fix nothing gets rendered without vsync

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-07-26 20:25:12 +01:00
parent c7bb6b0fe3
commit 3434ea25f4
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 5 additions and 4 deletions

View File

@ -360,15 +360,16 @@ static void present(backend_t *base, const region_t *region) {
xcb_render_composite(base->c, XCB_RENDER_PICT_OP_SRC, xd->back[2],
XCB_NONE, xd->target, orig_x, orig_y, 0, 0, orig_x,
orig_y, region_width, region_height);
// Only the target picture really holds the screen content, and its
// content is always up to date. So buffer age is always 1.
xd->buffer_age[xd->curr_back] = 1;
}
}
static int buffer_age(backend_t *backend_data) {
struct _xrender_data *xd = (void *)backend_data;
if (!xd->vsync) {
// Only the target picture really holds the screen content, and its
// content is always up to date. So buffer age is always 1.
return 1;
}
return xd->buffer_age[xd->curr_back];
}