@ -1504,6 +1504,7 @@ struct render_list_constructor_data {
struct wl_array * render_list ;
struct wl_array * render_list ;
bool calculate_visibility ;
bool calculate_visibility ;
bool highlight_transparent_region ;
bool highlight_transparent_region ;
bool fractional_scale ;
} ;
} ;
static bool construct_render_list_iterator ( struct wlr_scene_node * node ,
static bool construct_render_list_iterator ( struct wlr_scene_node * node ,
@ -1514,10 +1515,12 @@ static bool construct_render_list_iterator(struct wlr_scene_node *node,
return false ;
return false ;
}
}
// while rendering, the background should always be black.
// While rendering, the background should always be black. If we see a
// If we see a black rect, we can ignore rendering everything under the rect
// black rect, we can ignore rendering everything under the rect, and
// and even the rect itself.
// unless fractional scale is used even the rect itself (to avoid running
if ( node - > type = = WLR_SCENE_NODE_RECT & & data - > calculate_visibility ) {
// into issues regarding damage region expansion).
if ( node - > type = = WLR_SCENE_NODE_RECT & & data - > calculate_visibility & &
( ! data - > fractional_scale | | data - > render_list - > size = = 0 ) ) {
struct wlr_scene_rect * rect = wlr_scene_rect_from_node ( node ) ;
struct wlr_scene_rect * rect = wlr_scene_rect_from_node ( node ) ;
float * black = ( float [ 4 ] ) { 0.f , 0.f , 0.f , 1.f } ;
float * black = ( float [ 4 ] ) { 0.f , 0.f , 0.f , 1.f } ;
@ -1773,6 +1776,7 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output,
. render_list = & scene_output - > render_list ,
. render_list = & scene_output - > render_list ,
. calculate_visibility = scene_output - > scene - > calculate_visibility ,
. calculate_visibility = scene_output - > scene - > calculate_visibility ,
. highlight_transparent_region = scene_output - > scene - > highlight_transparent_region ,
. highlight_transparent_region = scene_output - > scene - > highlight_transparent_region ,
. fractional_scale = floor ( render_data . scale ) ! = render_data . scale ,
} ;
} ;
list_con . render_list - > size = 0 ;
list_con . render_list - > size = 0 ;