From b929a2bbadf467864796ad4ec90882ce86cfebff Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Sun, 6 Aug 2023 20:48:58 +0200 Subject: feat: add box shadows (#16) --- types/fx/shadow_data.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 types/fx/shadow_data.c (limited to 'types/fx/shadow_data.c') diff --git a/types/fx/shadow_data.c b/types/fx/shadow_data.c new file mode 100644 index 0000000..0c2d1d2 --- /dev/null +++ b/types/fx/shadow_data.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include "types/fx/shadow_data.h" +#include "wlr/util/log.h" + +struct shadow_data shadow_data_get_default(void) { + static float default_shadow_color[] = {0.0f, 0.0f, 0.0f, 0.5f}; + return (struct shadow_data) { + .blur_sigma = 20, + .color = default_shadow_color, + .enabled = false, + }; +} + +bool scene_buffer_has_shadow(struct shadow_data *data) { + return data->enabled && data->blur_sigma > 0 && data->color[3] > 0.0; +} -- cgit v1.2.3