Merge remote-tracking branch 'origin/master' into toplevel-effects
This commit is contained in:
commit
0b9524aa6d
3 changed files with 24 additions and 6 deletions
|
@ -424,8 +424,8 @@ void fx_renderer_begin(struct fx_renderer *renderer, int width, int height) {
|
||||||
fx_framebuffer_update(&renderer->effects_buffer_swapped, width, height);
|
fx_framebuffer_update(&renderer->effects_buffer_swapped, width, height);
|
||||||
|
|
||||||
// Add a stencil buffer to the main buffer & bind the main buffer
|
// Add a stencil buffer to the main buffer & bind the main buffer
|
||||||
fx_framebuffer_add_stencil_buffer(&renderer->main_buffer, width, height);
|
|
||||||
fx_framebuffer_bind(&renderer->main_buffer);
|
fx_framebuffer_bind(&renderer->main_buffer);
|
||||||
|
fx_framebuffer_add_stencil_buffer(&renderer->main_buffer, width, height);
|
||||||
|
|
||||||
// refresh projection matrix
|
// refresh projection matrix
|
||||||
matrix_projection(renderer->projection, width, height,
|
matrix_projection(renderer->projection, width, height,
|
||||||
|
|
|
@ -696,7 +696,19 @@ static void damage_surface_iterator(struct sway_output *output,
|
||||||
|
|
||||||
if (view) {
|
if (view) {
|
||||||
int blur_size = view->container->blur_enabled ? config_get_blur_size() : 0;
|
int blur_size = view->container->blur_enabled ? config_get_blur_size() : 0;
|
||||||
|
|
||||||
|
if (pixman_region32_not_empty(&damage)) {
|
||||||
|
int output_width, output_height;
|
||||||
|
wlr_output_transformed_resolution(output->wlr_output, &output_width, &output_height);
|
||||||
|
int32_t damage_width = damage.extents.x2 - damage.extents.x1;
|
||||||
|
int32_t damage_height = damage.extents.y2 - damage.extents.y1;
|
||||||
|
if (damage_width > output_width || damage_height > output_height) {
|
||||||
|
pixman_region32_intersect_rect(&damage, &damage, 0, 0, output_width, output_height);
|
||||||
|
} else {
|
||||||
wlr_region_expand(&damage, &damage, blur_size);
|
wlr_region_expand(&damage, &damage, blur_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
box.x -= blur_size;
|
box.x -= blur_size;
|
||||||
box.y -= blur_size;
|
box.y -= blur_size;
|
||||||
box.width += blur_size * 2;
|
box.width += blur_size * 2;
|
||||||
|
|
|
@ -1786,6 +1786,7 @@ void output_render(struct sway_output *output, struct timespec *when,
|
||||||
|
|
||||||
if (debug.damage == DAMAGE_RERENDER) {
|
if (debug.damage == DAMAGE_RERENDER) {
|
||||||
pixman_region32_union_rect(damage, damage, 0, 0, output_width, output_height);
|
pixman_region32_union_rect(damage, damage, 0, 0, output_width, output_height);
|
||||||
|
pixman_region32_copy(&extended_damage, damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pixman_region32_not_empty(damage)) {
|
if (!pixman_region32_not_empty(damage)) {
|
||||||
|
@ -1872,8 +1873,14 @@ void output_render(struct sway_output *output, struct timespec *when,
|
||||||
render_unmanaged(output, damage, &root->xwayland_unmanaged);
|
render_unmanaged(output, damage, &root->xwayland_unmanaged);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
bool should_render_blur = should_workspace_have_blur(workspace);
|
bool workspace_has_blur = should_workspace_have_blur(workspace);
|
||||||
if (should_render_blur) {
|
if (workspace_has_blur) {
|
||||||
|
if (config_should_parameters_blur() && renderer->blur_buffer_dirty) {
|
||||||
|
// Needs to be extended before clearing
|
||||||
|
pixman_region32_union_rect(damage, damage, 0, 0, output_width, output_height);
|
||||||
|
pixman_region32_union_rect(&extended_damage, &extended_damage, 0, 0, output_width, output_height);
|
||||||
|
}
|
||||||
|
|
||||||
// ensure that the damage isn't expanding past the output's size
|
// ensure that the damage isn't expanding past the output's size
|
||||||
int32_t damage_width = damage->extents.x2 - damage->extents.x1;
|
int32_t damage_width = damage->extents.x2 - damage->extents.x1;
|
||||||
int32_t damage_height = damage->extents.y2 - damage->extents.y1;
|
int32_t damage_height = damage->extents.y2 - damage->extents.y1;
|
||||||
|
@ -1900,8 +1907,7 @@ void output_render(struct sway_output *output, struct timespec *when,
|
||||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]);
|
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]);
|
||||||
|
|
||||||
// check if the background needs to be blurred
|
// check if the background needs to be blurred
|
||||||
if (config_should_parameters_blur() && renderer->blur_buffer_dirty && should_render_blur) {
|
if (config_should_parameters_blur() && renderer->blur_buffer_dirty && workspace_has_blur) {
|
||||||
pixman_region32_union_rect(damage, damage, 0, 0, output_width, output_height);
|
|
||||||
render_output_blur(output, damage);
|
render_output_blur(output, damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue