diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-07-22 19:18:06 -0400 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-07-22 19:23:36 -0400 |
commit | fd540f6d07169b78ab554ccbd83e77f88f8f26a6 (patch) | |
tree | 9e093a6ae9aed346e3d7bd5e0f04af879dc5271e | |
parent | a32180afa784c2d98e6be5377f9e86aee83d25d1 (diff) |
wlr_scene: Don't damage when setting opaque region
Opaque region is a optimization hint, (bugs outstanding) it will not
change the output contents, therefore damage does not need to be submitted.
However, we still need to update the visibility state of the other
nodes in the tree. To do this call scene_update_region() by ourselves
but not `scene_node_update()` which will damage the outputs.
-rw-r--r-- | types/scene/wlr_scene.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index a25cdd64..782950f3 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -764,7 +764,17 @@ void wlr_scene_buffer_set_opaque_region(struct wlr_scene_buffer *scene_buffer, } pixman_region32_copy(&scene_buffer->opaque_region, region); - scene_node_update(&scene_buffer->node, NULL); + + int x, y; + if (!wlr_scene_node_coords(&scene_buffer->node, &x, &y)) { + return; + } + + pixman_region32_t update_region; + pixman_region32_init(&update_region); + scene_node_bounds(&scene_buffer->node, x, y, &update_region); + scene_update_region(scene_node_get_root(&scene_buffer->node), &update_region); + pixman_region32_fini(&update_region); } void wlr_scene_buffer_set_source_box(struct wlr_scene_buffer *scene_buffer, |