diff options
| author | Alexander Orzechowski <[email protected]> | 2022-06-25 18:22:00 -0400 | 
|---|---|---|
| committer | Alexander Orzechowski <[email protected]> | 2022-08-14 02:38:50 -0400 | 
| commit | ab1ebc20123b11e8f09e347dd74e9ae63c8a4443 (patch) | |
| tree | f48381bf5812b6215b79223c7edf5364f6a62bf0 | |
| parent | 4539c226cb796cb337023097c5aed6de3c06cdc2 (diff) | |
wlr_scene_set_buffer_with_damage: Only damage the visible parts of the node
| -rw-r--r-- | wlr_scene.c | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/wlr_scene.c b/wlr_scene.c index 498fa87..94d0c02 100644 --- a/wlr_scene.c +++ b/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);  | 
