fix: blur not being able to blur edges of damage (#168)
This commit is contained in:
parent
8e6667ddad
commit
c95306fcdf
|
@ -161,8 +161,6 @@ void fx_renderer_fini(struct fx_renderer *renderer);
|
|||
|
||||
void fx_renderer_begin(struct fx_renderer *renderer, int width, int height);
|
||||
|
||||
void fx_renderer_end(struct fx_renderer *renderer);
|
||||
|
||||
void fx_renderer_clear(const float color[static 4]);
|
||||
|
||||
void fx_renderer_scissor(struct wlr_box *box);
|
||||
|
|
|
@ -424,11 +424,6 @@ void fx_renderer_begin(struct fx_renderer *renderer, int width, int height) {
|
|||
fx_framebuffer_bind(&renderer->main_buffer);
|
||||
}
|
||||
|
||||
void fx_renderer_end(struct fx_renderer *renderer) {
|
||||
// Release the main buffer
|
||||
fx_framebuffer_release(&renderer->main_buffer);
|
||||
}
|
||||
|
||||
void fx_renderer_clear(const float color[static 4]) {
|
||||
glClearColor(color[0], color[1], color[2], color[3]);
|
||||
glClearStencil(0);
|
||||
|
|
|
@ -248,18 +248,12 @@ struct fx_framebuffer *get_main_buffer_blur(struct fx_renderer *renderer, struct
|
|||
// damage region will be scaled, make a temp
|
||||
pixman_region32_t tempDamage;
|
||||
pixman_region32_init(&tempDamage);
|
||||
// When DOWNscaling, we make the region twice as small because it's the TARGET
|
||||
wlr_region_scale(&tempDamage, &damage, 0.5f);
|
||||
|
||||
int blur_radius = config->blur_params.radius;
|
||||
int blur_passes = config->blur_params.num_passes;
|
||||
|
||||
// First pass
|
||||
render_blur_segments(renderer, gl_matrix, &tempDamage, ¤t_buffer,
|
||||
&renderer->shaders.blur1, box, blur_radius);
|
||||
|
||||
// Downscale
|
||||
for (int i = 1; i < blur_passes; ++i) {
|
||||
for (int i = 0; i < blur_passes; ++i) {
|
||||
wlr_region_scale(&tempDamage, &damage, 1.0f / (1 << (i + 1)));
|
||||
render_blur_segments(renderer, gl_matrix, &tempDamage, ¤t_buffer,
|
||||
&renderer->shaders.blur1, box, blur_radius);
|
||||
|
@ -1975,7 +1969,6 @@ renderer_end:
|
|||
}
|
||||
|
||||
render_whole_output(renderer, wlr_output, &extended_damage, &renderer->main_buffer.texture);
|
||||
fx_renderer_end(renderer);
|
||||
|
||||
fx_renderer_scissor(NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue