aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-04-27 11:19:58 +0200
committerSimon Ser <contact@emersion.fr>2023-05-02 18:31:55 +0200
commitd5cc474aef6bf5a23694053ab9c8770ea3f21e6f (patch)
tree9bead7ab099de9675204d82ae397746cec232ff8 /sway/desktop/output.c
parent33cfdbe886144e8515593d96a80d850a7c6e382e (diff)
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.c14
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) {
pixman_region32_init(&damage);
wlr_damage_ring_get_buffer_damage(&output->damage_ring, buffer_age, &damage);
+ if (debug.damage == DAMAGE_RERENDER) {
+ int width, height;
+ wlr_output_transformed_resolution(wlr_output, &width, &height);
+ pixman_region32_union_rect(&damage, &damage, 0, 0, width, height);
+ }
+
+ struct render_context ctx = {
+ .output_damage = &damage,
+ .renderer = wlr_output->renderer,
+ .output = output,
+ };
+
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
- output_render(output, &damage);
+ output_render(&ctx);
pixman_region32_fini(&damage);