diff options
author | Erik Reider <[email protected]> | 2023-08-06 20:48:58 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2023-08-06 14:48:58 -0400 |
commit | b929a2bbadf467864796ad4ec90882ce86cfebff (patch) | |
tree | 8229d63bfe8e1ba7908c5ca988c3bb774ea7990b /types/fx | |
parent | a2b827ab71f51240a192fa20913f6e83d8528612 (diff) |
feat: add box shadows (#16)
Diffstat (limited to 'types/fx')
-rw-r--r-- | types/fx/meson.build | 3 | ||||
-rw-r--r-- | types/fx/shadow_data.c | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/types/fx/meson.build b/types/fx/meson.build new file mode 100644 index 0000000..b7f0207 --- /dev/null +++ b/types/fx/meson.build @@ -0,0 +1,3 @@ +wlr_files += files( + '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 <assert.h> +#include <stdlib.h> +#include <string.h> +#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; +} |