output: optimize when drawing whole surface

This commit is contained in:
Jente Hidskes 2019-02-13 22:00:01 +01:00
parent a114ddbbf3
commit 5a1da1baee

View file

@ -85,7 +85,9 @@ damage_surface(struct wlr_surface *surface, int sx, int sy, void *data)
.height = surface->current.height * wlr_output->scale,
};
if (pixman_region32_not_empty(&surface->buffer_damage)) {
if (ddata->whole) {
wlr_output_damage_add_box(output->damage, &box);
} else if (pixman_region32_not_empty(&surface->buffer_damage)) {
pixman_region32_t damage;
pixman_region32_init(&damage);
wlr_surface_get_effective_damage(surface, &damage);
@ -102,10 +104,6 @@ damage_surface(struct wlr_surface *surface, int sx, int sy, void *data)
wlr_output_damage_add(output->damage, &damage);
pixman_region32_fini(&damage);
}
if (ddata->whole) {
wlr_output_damage_add_box(output->damage, &box);
}
}
/* Used to move all of the data necessary to render a surface from the