From e9f14c748c92ee5a45c9b4b9942b173337e0dea9 Mon Sep 17 00:00:00 2001 From: William McKinnon Date: Sun, 23 Jul 2023 23:25:38 -0400 Subject: [PATCH] removed unneeded src_box --- .../sway/desktop/fx_renderer/fx_renderer.h | 2 ++ sway/desktop/fx_renderer/fx_renderer.c | 5 ++++ sway/desktop/render.c | 25 ++++++------------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/include/sway/desktop/fx_renderer/fx_renderer.h b/include/sway/desktop/fx_renderer/fx_renderer.h index 4a60a7ea..51f60557 100644 --- a/include/sway/desktop/fx_renderer/fx_renderer.h +++ b/include/sway/desktop/fx_renderer/fx_renderer.h @@ -161,6 +161,8 @@ 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); diff --git a/sway/desktop/fx_renderer/fx_renderer.c b/sway/desktop/fx_renderer/fx_renderer.c index 744e23ac..146c6a4f 100644 --- a/sway/desktop/fx_renderer/fx_renderer.c +++ b/sway/desktop/fx_renderer/fx_renderer.c @@ -421,6 +421,11 @@ void fx_renderer_begin(struct fx_renderer *renderer, int width, int height) { glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); } +void fx_renderer_end(struct fx_renderer *renderer) { + // Draw the contents of our buffer into the wlr buffer + fx_framebuffer_bind(&renderer->wlr_buffer); +} + void fx_renderer_clear(const float color[static 4]) { glClearColor(color[0], color[1], color[2], color[3]); glClearStencil(0); diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 945ce16e..d92e0007 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -276,10 +276,9 @@ struct fx_framebuffer *get_main_buffer_blur(struct fx_renderer *renderer, struct return current_buffer; } -void render_blur(bool optimized, struct sway_output *output, - pixman_region32_t *output_damage, const struct wlr_fbox *src_box, - const struct wlr_box *dst_box, pixman_region32_t *opaque_region, - int corner_radius, bool should_round_top) { +void render_blur(bool optimized, struct sway_output *output, pixman_region32_t *output_damage, + const struct wlr_box *dst_box, pixman_region32_t *opaque_region, int corner_radius, + bool should_round_top) { struct wlr_output *wlr_output = output->wlr_output; struct fx_renderer *renderer = output->renderer; @@ -321,7 +320,8 @@ void render_blur(bool optimized, struct sway_output *output, struct decoration_data deco_data = get_undecorated_decoration_data(); deco_data.corner_radius = corner_radius; deco_data.has_titlebar = should_round_top; - render_texture(wlr_output, &damage, &buffer->texture, src_box, dst_box, matrix, deco_data); + const struct wlr_fbox src_box = wlr_fbox_from_wlr_box(&monitor_box); + render_texture(wlr_output, &damage, &buffer->texture, &src_box, dst_box, matrix, deco_data); damage_finish: pixman_region32_fini(&damage); @@ -434,11 +434,7 @@ static void render_surface_iterator(struct sway_output *output, if (has_alpha) { bool should_optimize_blur = view ? !container_is_floating(view->container) || config->blur_xray : false; - struct wlr_box monitor_box = get_monitor_box(wlr_output); - wlr_box_transform(&monitor_box, &monitor_box, - wlr_output_transform_invert(wlr_output->transform), monitor_box.width, monitor_box.height); - struct wlr_fbox blur_src_box = wlr_fbox_from_wlr_box(&monitor_box); - render_blur(should_optimize_blur, output, output_damage, &blur_src_box, &dst_box, &opaque_region, + render_blur(should_optimize_blur, output, output_damage, &dst_box, &opaque_region, deco_data.corner_radius, deco_data.has_titlebar); } @@ -812,12 +808,8 @@ static void render_saved_view(struct sway_view *view, struct sway_output *output pixman_region32_init(&opaque_region); pixman_region32_union_rect(&opaque_region, &opaque_region, 0, 0, 0, 0); - struct wlr_box monitor_box = get_monitor_box(wlr_output); - wlr_box_transform(&monitor_box, &monitor_box, - wlr_output_transform_invert(wlr_output->transform), monitor_box.width, monitor_box.height); - struct wlr_fbox src_box = wlr_fbox_from_wlr_box(&monitor_box); bool should_optimize_blur = !container_is_floating(view->container) || config->blur_xray; - render_blur(should_optimize_blur, output, damage, &src_box, &dst_box, &opaque_region, + render_blur(should_optimize_blur, output, damage, &dst_box, &opaque_region, deco_data.corner_radius, deco_data.has_titlebar); pixman_region32_fini(&opaque_region); @@ -1965,8 +1957,7 @@ render_overlay: render_drag_icons(output, damage, &root->drag_icons); renderer_end: - // Draw the contents of our buffer into the wlr buffer - fx_framebuffer_bind(&renderer->wlr_buffer); + fx_renderer_end(output->renderer); float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; if (pixman_region32_not_empty(&extended_damage)) {