parent
04b657b58c
commit
303b7dfb69
|
@ -773,6 +773,8 @@ int config_get_blur_size();
|
|||
|
||||
bool config_should_parameters_blur();
|
||||
|
||||
bool config_should_parameters_blur_effects();
|
||||
|
||||
bool config_should_parameters_shadow();
|
||||
|
||||
/* Global config singleton. */
|
||||
|
|
|
@ -1109,6 +1109,13 @@ bool config_should_parameters_blur() {
|
|||
return config->blur_params.radius > 0 && config->blur_params.num_passes > 0;
|
||||
}
|
||||
|
||||
bool config_should_parameters_blur_effects() {
|
||||
return config->blur_params.brightness != 1.0f
|
||||
|| config->blur_params.saturation != 1.0f
|
||||
|| config->blur_params.contrast != 1.0f
|
||||
|| config->blur_params.noise > 0.0f;
|
||||
}
|
||||
|
||||
bool config_should_parameters_shadow() {
|
||||
return config->shadow_blur_sigma > 0 && config->shadow_color[3] > 0.0;
|
||||
}
|
||||
|
|
|
@ -930,7 +930,6 @@ void fx_render_blur_effects(struct fx_renderer *renderer, const float matrix[sta
|
|||
float blur_contrast, float blur_saturation) {
|
||||
struct effects_shader shader = renderer->shaders.blur_effects;
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture((*buffer)->texture.target, (*buffer)->texture.id);
|
||||
glTexParameteri((*buffer)->texture.target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
|
|
@ -263,7 +263,13 @@ struct fx_framebuffer *get_main_buffer_blur(struct fx_renderer *renderer, struct
|
|||
float blur_contrast = config->blur_params.contrast;
|
||||
float blur_saturation = config->blur_params.saturation;
|
||||
|
||||
if (pixman_region32_not_empty(&damage)) {
|
||||
// Render additional blur effects like saturation, noise, contrast, etc...
|
||||
if (config_should_parameters_blur_effects() && pixman_region32_not_empty(&damage)) {
|
||||
if (current_buffer == &renderer->effects_buffer) {
|
||||
fx_framebuffer_bind(&renderer->effects_buffer_swapped);
|
||||
} else {
|
||||
fx_framebuffer_bind(&renderer->effects_buffer);
|
||||
}
|
||||
int nrects;
|
||||
pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects);
|
||||
for (int i = 0; i < nrects; ++i) {
|
||||
|
@ -273,6 +279,11 @@ struct fx_framebuffer *get_main_buffer_blur(struct fx_renderer *renderer, struct
|
|||
fx_render_blur_effects(renderer, gl_matrix, ¤t_buffer, blur_noise,
|
||||
blur_brightness, blur_contrast, blur_saturation);
|
||||
}
|
||||
if (current_buffer != &renderer->effects_buffer) {
|
||||
current_buffer = &renderer->effects_buffer;
|
||||
} else {
|
||||
current_buffer = &renderer->effects_buffer_swapped;
|
||||
}
|
||||
}
|
||||
|
||||
pixman_region32_fini(&tempDamage);
|
||||
|
|
Loading…
Reference in a new issue