Skip to content

Commit

Permalink
Made blur impl independent of wlr_scene
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikReider committed Feb 26, 2024
1 parent e18878d commit 0651668
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion include/render/pass.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ struct fx_render_rect_options fx_render_rect_options_default(

struct fx_render_blur_pass_options {
struct fx_render_texture_options tex_options;
struct wlr_scene_buffer *scene_buffer;
pixman_region32_t opaque_region;
struct wlr_output *output;
struct wlr_box monitor_box;
struct fx_framebuffer *current_buffer;
struct blur_data *blur_data;
bool use_optimized_blur;
bool ignore_transparent;
};

Expand Down
6 changes: 2 additions & 4 deletions render/fx_renderer/fx_pass.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "render/pass.h"
#include "scenefx/types/fx/blur_data.h"
#include "scenefx/types/fx/shadow_data.h"
#include "scenefx/types/wlr_scene.h"

#define MAX_QUADS 86 // 4kb

Expand Down Expand Up @@ -660,7 +659,6 @@ void fx_render_pass_add_blur(struct fx_gles_render_pass *pass,
struct fx_renderer *renderer = pass->buffer->renderer;
struct fx_render_texture_options *tex_options = &fx_options->tex_options;
const struct wlr_render_texture_options *options = &tex_options->base;
struct wlr_scene_buffer *scene_buffer = fx_options->scene_buffer;

pixman_region32_t translucent_region;
pixman_region32_init(&translucent_region);
Expand All @@ -670,14 +668,14 @@ void fx_render_pass_add_blur(struct fx_gles_render_pass *pass,

// Gets the translucent region
pixman_box32_t surface_box = { 0, 0, dst_box.width, dst_box.height };
pixman_region32_copy(&translucent_region, &scene_buffer->opaque_region);
pixman_region32_copy(&translucent_region, &fx_options->opaque_region);
pixman_region32_inverse(&translucent_region, &translucent_region, &surface_box);
if (!pixman_region32_not_empty(&translucent_region)) {
goto damage_finish;
}

struct fx_framebuffer *buffer = renderer->optimized_blur_buffer;
if (!buffer || !scene_buffer->backdrop_blur_optimized) {
if (!buffer || !fx_options->use_optimized_blur) {
pixman_region32_translate(&translucent_region, dst_box.x, dst_box.y);
pixman_region32_intersect(&translucent_region, &translucent_region, options->clip);

Expand Down

0 comments on commit 0651668

Please sign in to comment.