diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-06-25 18:22:00 -0400 |
---|---|---|
committer | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-08-14 02:38:50 -0400 |
commit | 6d62300324593ae123e04343cb949029a1bd4990 (patch) | |
tree | 5a642fd41cfc35cdd529be75cb87e1ef64074214 | |
parent | c6246272fd46136a2cc3924d7c7f01cfa6e33f0c (diff) |
wlr_scene_set_buffer_with_damage: Only damage the visible parts of the node
-rw-r--r-- | types/scene/wlr_scene.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 498fa878..94d0c02c 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -577,6 +577,14 @@ void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buff pixman_region32_init(&output_damage); wlr_region_scale_xy(&output_damage, &trans_damage, output_scale * scale_x, output_scale * scale_y); + + pixman_region32_t cull_region; + pixman_region32_init(&cull_region); + wlr_region_scale(&cull_region, &scene_buffer->node.visible, output_scale); + pixman_region32_translate(&cull_region, -lx * output_scale, -ly * output_scale); + pixman_region32_intersect(&output_damage, &output_damage, &cull_region); + pixman_region32_fini(&cull_region); + pixman_region32_translate(&output_damage, (lx - scene_output->x) * output_scale, (ly - scene_output->y) * output_scale); |