summaryrefslogtreecommitdiff
path: root/sway/desktop/fx_renderer/fx_renderer.c
diff options
context:
space:
mode:
authorfamfo <[email protected]>2023-12-22 06:08:09 +0000
committerGitHub <[email protected]>2023-12-22 01:08:09 -0500
commitca42d414536c167f951e23bfc50d5edabb6f9dc2 (patch)
tree989ef953da5cc98a826de4bf19dc2aad34d8f1be /sway/desktop/fx_renderer/fx_renderer.c
parent5e866d0345449f34ac51c6590a3aac285cb2f8bf (diff)
Implement shadow_offset (#255)
Diffstat (limited to 'sway/desktop/fx_renderer/fx_renderer.c')
-rw-r--r--sway/desktop/fx_renderer/fx_renderer.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sway/desktop/fx_renderer/fx_renderer.c b/sway/desktop/fx_renderer/fx_renderer.c
index 07758325..7196bb0e 100644
--- a/sway/desktop/fx_renderer/fx_renderer.c
+++ b/sway/desktop/fx_renderer/fx_renderer.c
@@ -799,8 +799,8 @@ void fx_render_stencil_mask(struct fx_renderer *renderer, const struct wlr_box *
// TODO: alpha input arg?
void fx_render_box_shadow(struct fx_renderer *renderer, const struct wlr_box *box,
- const float color[static 4], const float matrix[static 9], int corner_radius,
- float blur_sigma) {
+ const struct wlr_box *inner_box, const float color[static 4],
+ const float matrix[static 9], int corner_radius, float blur_sigma) {
if (box->width == 0 || box->height == 0) {
return;
}
@@ -821,17 +821,9 @@ void fx_render_box_shadow(struct fx_renderer *renderer, const struct wlr_box *bo
wlr_matrix_transpose(gl_matrix, gl_matrix);
- // Init stencil work
- struct wlr_box inner_box;
- memcpy(&inner_box, box, sizeof(struct wlr_box));
- inner_box.x += blur_sigma;
- inner_box.y += blur_sigma;
- inner_box.width -= blur_sigma * 2;
- inner_box.height -= blur_sigma * 2;
-
fx_renderer_stencil_mask_init();
// Draw the rounded rect as a mask
- fx_render_stencil_mask(renderer, &inner_box, matrix, corner_radius);
+ fx_render_stencil_mask(renderer, inner_box, matrix, corner_radius);
fx_renderer_stencil_mask_close(false);
// blending will practically always be needed (unless we have a madman