mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-12 16:35:58 +01:00
wlr_output_damage: Don't schedule a new frame if damage region does not intersect with output
This fixed adaptive sync issues with wlr_scene. Scenes don't check if the damage region intersects with an output when calling wlr_output_damage_add. This is especially important for multi output.
This commit is contained in:
parent
fbd4d40318
commit
f330759ba4
1 changed files with 11 additions and 5 deletions
|
@ -187,11 +187,17 @@ void wlr_output_damage_add(struct wlr_output_damage *output_damage,
|
|||
int width, height;
|
||||
wlr_output_transformed_resolution(output_damage->output, &width, &height);
|
||||
|
||||
pixman_region32_union(&output_damage->current, &output_damage->current,
|
||||
damage);
|
||||
pixman_region32_intersect_rect(&output_damage->current,
|
||||
&output_damage->current, 0, 0, width, height);
|
||||
wlr_output_schedule_frame(output_damage->output);
|
||||
pixman_region32_t clipped_damage;
|
||||
pixman_region32_init(&clipped_damage);
|
||||
pixman_region32_intersect_rect(&clipped_damage, damage, 0, 0, width, height);
|
||||
|
||||
if (pixman_region32_not_empty(&clipped_damage)) {
|
||||
pixman_region32_union(&output_damage->current, &output_damage->current,
|
||||
&clipped_damage);
|
||||
wlr_output_schedule_frame(output_damage->output);
|
||||
}
|
||||
|
||||
pixman_region32_fini(&clipped_damage);
|
||||
}
|
||||
|
||||
void wlr_output_damage_add_whole(struct wlr_output_damage *output_damage) {
|
||||
|
|
Loading…
Reference in a new issue