From 1ecdf4e89c5a2b757f7abb9c2de2a8b5e6f16d68 Mon Sep 17 00:00:00 2001 From: Jente Hidskes Date: Wed, 13 Feb 2019 22:00:01 +0100 Subject: [PATCH] output: optimize when drawing whole surface --- output.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/output.c b/output.c index f36c229..a9cb3ef 100644 --- a/output.c +++ b/output.c @@ -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