@@ -751,6 +751,8 @@ static bool rebuild_live_blur(output_t *output, uint64_t shared_blurred, pixman_
751751 effects_output_t * ctx = output -> effects ;
752752 int w = output -> width , h = output -> height ;
753753 bool any = false;
754+ bool blur_buf_reusable = ctx -> blur_buf && ctx -> blur_native [0 ] && ctx -> blur_buf_w == ctx -> blur_w &&
755+ ctx -> blur_buf_h == ctx -> blur_h ;
754756
755757 struct be_blur_params bp = {
756758 .algorithm = blur_algorithm ,
@@ -814,9 +816,12 @@ static bool rebuild_live_blur(output_t *output, uint64_t shared_blurred, pixman_
814816 }
815817
816818 int n_scissor = 0 ;
817- const pixman_box32_t * scissor = blur_damage_boxes (ctx , damage , w , h , & n_scissor );
818- effects_backend -> blur (& ctx -> be_state , shared_blurred , ctx -> blur_w , ctx -> blur_h , & bp ,
819- ctx -> blur_native [0 ], scissor , n_scissor , NULL );
819+ const pixman_box32_t * scissor = NULL ;
820+ if (blur_buf_reusable )
821+ scissor = blur_damage_boxes (ctx , damage , w , h , & n_scissor );
822+ if (!effects_backend -> blur (& ctx -> be_state , shared_blurred , ctx -> blur_w , ctx -> blur_h , & bp ,
823+ ctx -> blur_native [0 ], scissor , n_scissor , NULL ))
824+ return false;
820825 ctx -> blur_gen = ctx -> backdrop_gen ;
821826 }
822827 any = true;
@@ -1061,6 +1066,8 @@ static void push_blur_to_toplevels(output_t *output) {
10611066static bool rebuild_live_blur_layers (output_t * output , uint64_t bg_tex , pixman_region32_t * damage ) {
10621067 effects_output_t * ctx = output -> effects ;
10631068 int w = output -> width , h = output -> height ;
1069+ bool layer_blur_buf_reusable = ctx -> layer_blur_buf && ctx -> layer_blur_native [0 ] &&
1070+ ctx -> layer_blur_buf_w == ctx -> blur_w && ctx -> layer_blur_buf_h == ctx -> blur_h ;
10641071
10651072 struct be_blur_params bp = {
10661073 .algorithm = blur_algorithm ,
@@ -1090,9 +1097,12 @@ static bool rebuild_live_blur_layers(output_t *output, uint64_t bg_tex, pixman_r
10901097 return false;
10911098
10921099 int n_scissor = 0 ;
1093- const pixman_box32_t * scissor = blur_damage_boxes (ctx , damage , w , h , & n_scissor );
1094- effects_backend -> blur (& ctx -> be_state , bg_tex , ctx -> blur_w , ctx -> blur_h , & bp ,
1095- ctx -> layer_blur_native [0 ], scissor , n_scissor , NULL );
1100+ const pixman_box32_t * scissor = NULL ;
1101+ if (layer_blur_buf_reusable )
1102+ scissor = blur_damage_boxes (ctx , damage , w , h , & n_scissor );
1103+ if (!effects_backend -> blur (& ctx -> be_state , bg_tex , ctx -> blur_w , ctx -> blur_h , & bp ,
1104+ ctx -> layer_blur_native [0 ], scissor , n_scissor , NULL ))
1105+ return false;
10961106 ctx -> layer_blur_gen = ctx -> backdrop_gen ;
10971107 return true;
10981108}
@@ -1735,7 +1745,7 @@ static bool rebuild_corner_masks(output_t *output, uint64_t bg_tex) {
17351745 if (content_r .width <= 0 || content_r .height <= 0 )
17361746 continue ;
17371747
1738- uint64_t src ;
1748+ uint64_t src = 0 ;
17391749 if (bg_tex ) {
17401750 src = bg_tex ;
17411751 } else {
@@ -1775,10 +1785,12 @@ static bool rebuild_corner_masks(output_t *output, uint64_t bg_tex) {
17751785 if (bnode )
17761786 HIDE_IF (& bnode -> node );
17771787 }
1778- HIDE_IF (& tl -> blur -> mica_node -> node );
1779- HIDE_IF (& tl -> blur -> acrylic_node -> node );
1788+ if (tl -> blur -> mica_node )
1789+ HIDE_IF (& tl -> blur -> mica_node -> node );
1790+ if (tl -> blur -> acrylic_node )
1791+ HIDE_IF (& tl -> blur -> acrylic_node -> node );
17801792 }
1781- if (tl -> rounded )
1793+ if (tl -> rounded && tl -> rounded -> corner_mask_node )
17821794 HIDE_IF (& tl -> rounded -> corner_mask_node -> node );
17831795
17841796 wlr_damage_ring_add_whole (& ctx -> capture_scene_output -> damage_ring );
@@ -1937,12 +1949,13 @@ static uint64_t capture_full_scene_to_tex(output_t *output, effects_output_t *ct
19371949 wlr_scene_output_set_position (ctx -> capture_scene_output , -0x7fff , -0x7fff );
19381950
19391951 if (!ok || !ctx -> capture_state .buffer ) {
1940- wlr_buffer_unlock (ctx -> capture_state .buffer );
1952+ if (ctx -> capture_state .buffer )
1953+ wlr_buffer_unlock (ctx -> capture_state .buffer );
19411954 ctx -> capture_state .buffer = NULL ;
19421955 return 0 ;
19431956 }
19441957
1945- uint64_t result ;
1958+ uint64_t result = 0 ;
19461959 effects_backend -> capture_readback (ctx -> capture_state .buffer , & ctx -> be_state , screen_fbo , 0 , 0 , w , h ,
19471960 0 , 0 , w , h , & result );
19481961
0 commit comments