From 4f1104654fc57449b7b6c13967e400aa130ea3f9 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Wed, 14 Aug 2024 11:23:30 -0400 Subject: [PATCH] wlr_scene: Fix WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT when output is transformed --- types/scene/wlr_scene.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index d1d89018..b8bfe428 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -2066,11 +2066,18 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output, int64_t time_diff_ms = timespec_to_msec(&time_diff); float alpha = 1.0 - (double)time_diff_ms / HIGHLIGHT_DAMAGE_FADEOUT_TIME; + pixman_region32_t clip; + pixman_region32_init(&clip); + pixman_region32_copy(&clip, &damage->region); + transform_output_damage(&clip, &render_data); + wlr_render_pass_add_rect(render_pass, &(struct wlr_render_rect_options){ .box = { .width = buffer->width, .height = buffer->height }, .color = { .r = alpha * 0.5, .g = 0, .b = 0, .a = alpha * 0.5 }, - .clip = &damage->region, + .clip = &clip, }); + + pixman_region32_fini(&clip); } }