moved blur damage to damage_surface_iterator
This commit is contained in:
parent
690f5c37ff
commit
e6d1ee8b4d
1 changed files with 14 additions and 6 deletions
|
@ -689,6 +689,16 @@ static void damage_surface_iterator(struct sway_output *output,
|
|||
ceil(output->wlr_output->scale) - surface->current.scale);
|
||||
}
|
||||
pixman_region32_translate(&damage, box.x, box.y);
|
||||
|
||||
if (view) {
|
||||
int blur_size = view->container->blur_enabled ? config_get_blur_size() : 0;
|
||||
wlr_region_expand(&damage, &damage, blur_size);
|
||||
box.x -= blur_size;
|
||||
box.y -= blur_size;
|
||||
box.width += blur_size * 2;
|
||||
box.height += blur_size * 2;
|
||||
}
|
||||
|
||||
if (wlr_damage_ring_add(&output->damage_ring, &damage)) {
|
||||
wlr_output_schedule_frame(output->wlr_output);
|
||||
}
|
||||
|
@ -746,15 +756,13 @@ static void damage_child_views_iterator(struct sway_container *con,
|
|||
void output_damage_whole_container(struct sway_output *output,
|
||||
struct sway_container *con) {
|
||||
int shadow_sigma = con->shadow_enabled ? config->shadow_blur_sigma : 0;
|
||||
int blur_size = con->blur_enabled ? config_get_blur_size() : 0;
|
||||
int effect_size = MAX(shadow_sigma, blur_size);
|
||||
|
||||
// Pad the box by 1px, because the width is a double and might be a fraction
|
||||
struct wlr_box box = {
|
||||
.x = con->current.x - output->lx - 1 - effect_size,
|
||||
.y = con->current.y - output->ly - 1 - effect_size,
|
||||
.width = con->current.width + 2 + effect_size * 2,
|
||||
.height = con->current.height + 2 + effect_size * 2,
|
||||
.x = con->current.x - output->lx - 1 - shadow_sigma,
|
||||
.y = con->current.y - output->ly - 1 - shadow_sigma,
|
||||
.width = con->current.width + 2 + shadow_sigma * 2,
|
||||
.height = con->current.height + 2 + shadow_sigma * 2,
|
||||
};
|
||||
scale_box(&box, output->wlr_output->scale);
|
||||
if (wlr_damage_ring_add_box(&output->damage_ring, &box)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue