diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-04-27 11:19:58 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-05-02 18:31:55 +0200 |
commit | d5cc474aef6bf5a23694053ab9c8770ea3f21e6f (patch) | |
tree | 9bead7ab099de9675204d82ae397746cec232ff8 /sway/desktop/output.c | |
parent | xdg_shell: Fix crash if popup generates while toplevel is in the scratchpad (diff) | |
download | sway-d5cc474aef6bf5a23694053ab9c8770ea3f21e6f.tar.gz sway-d5cc474aef6bf5a23694053ab9c8770ea3f21e6f.tar.zst sway-d5cc474aef6bf5a23694053ab9c8770ea3f21e6f.zip |
render: pass rendering state together in a struct
This lets us easily add rendering state that we need in the future
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 2255b551..02e08bd2 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -613,10 +613,22 @@ static int output_repaint_timer_handler(void *data) { | |||
613 | pixman_region32_init(&damage); | 613 | pixman_region32_init(&damage); |
614 | wlr_damage_ring_get_buffer_damage(&output->damage_ring, buffer_age, &damage); | 614 | wlr_damage_ring_get_buffer_damage(&output->damage_ring, buffer_age, &damage); |
615 | 615 | ||
616 | if (debug.damage == DAMAGE_RERENDER) { | ||
617 | int width, height; | ||
618 | wlr_output_transformed_resolution(wlr_output, &width, &height); | ||
619 | pixman_region32_union_rect(&damage, &damage, 0, 0, width, height); | ||
620 | } | ||
621 | |||
622 | struct render_context ctx = { | ||
623 | .output_damage = &damage, | ||
624 | .renderer = wlr_output->renderer, | ||
625 | .output = output, | ||
626 | }; | ||
627 | |||
616 | struct timespec now; | 628 | struct timespec now; |
617 | clock_gettime(CLOCK_MONOTONIC, &now); | 629 | clock_gettime(CLOCK_MONOTONIC, &now); |
618 | 630 | ||
619 | output_render(output, &damage); | 631 | output_render(&ctx); |
620 | 632 | ||
621 | pixman_region32_fini(&damage); | 633 | pixman_region32_fini(&damage); |
622 | 634 | ||