Make backend_info_t::buffer_age optional

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-01-27 19:32:00 +00:00
parent b50f15c835
commit 22f0d10c65
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 3 additions and 1 deletions

View File

@ -24,8 +24,10 @@ bool default_is_frame_transparent(void *backend_data, win *w, void *win_data) {
region_t get_damage(session_t *ps) { region_t get_damage(session_t *ps) {
region_t region; region_t region;
auto buffer_age_fn = backend_list[ps->o.backend]->buffer_age;
int buffer_age = buffer_age_fn ? buffer_age_fn(ps->backend_data, ps) : -1;
pixman_region32_init(&region); pixman_region32_init(&region);
int buffer_age = backend_list[ps->o.backend]->buffer_age(ps->backend_data, ps);
if (buffer_age == -1 || buffer_age > ps->ndamage) { if (buffer_age == -1 || buffer_age > ps->ndamage) {
pixman_region32_copy(&region, &ps->screen_reg); pixman_region32_copy(&region, &ps->screen_reg);
} else { } else {