summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorozwaldorf <[email protected]>2024-01-03 12:38:44 -0500
committerGitHub <[email protected]>2024-01-03 12:38:44 -0500
commit04b657b58cf54ac611f73723ec44f51feba16b15 (patch)
treee8c310f8957ded3304503dc1d908b8a233bbae20 /include
parent1c5c60d9280eb0b13d9884366bdeaf3748b04308 (diff)
feat: blur tweaks (#258)
Diffstat (limited to 'include')
-rw-r--r--include/sway/commands.h4
-rw-r--r--include/sway/config.h4
-rw-r--r--include/sway/desktop/fx_renderer/fx_renderer.h21
3 files changed, 27 insertions, 2 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h
index c29d4ff4..b8f5660a 100644
--- a/include/sway/commands.h
+++ b/include/sway/commands.h
@@ -115,8 +115,12 @@ sway_cmd cmd_bindgesture;
sway_cmd cmd_bindswitch;
sway_cmd cmd_bindsym;
sway_cmd cmd_blur;
+sway_cmd cmd_blur_brightness;
+sway_cmd cmd_blur_contrast;
+sway_cmd cmd_blur_noise;
sway_cmd cmd_blur_passes;
sway_cmd cmd_blur_radius;
+sway_cmd cmd_blur_saturation;
sway_cmd cmd_blur_xray;
sway_cmd cmd_border;
sway_cmd cmd_client_noop;
diff --git a/include/sway/config.h b/include/sway/config.h
index 81213dbc..2bb33352 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -473,6 +473,10 @@ enum xwayland_mode {
struct blur_parameters {
int num_passes;
int radius;
+ float noise;
+ float brightness;
+ float contrast;
+ float saturation;
};
/**
diff --git a/include/sway/desktop/fx_renderer/fx_renderer.h b/include/sway/desktop/fx_renderer/fx_renderer.h
index bfae7b72..924d9951 100644
--- a/include/sway/desktop/fx_renderer/fx_renderer.h
+++ b/include/sway/desktop/fx_renderer/fx_renderer.h
@@ -47,6 +47,18 @@ struct blur_shader {
GLint halfpixel;
};
+struct effects_shader {
+ GLuint program;
+ GLint proj;
+ GLint tex;
+ GLint pos_attrib;
+ GLint tex_attrib;
+ GLfloat noise;
+ GLfloat brightness;
+ GLfloat contrast;
+ GLfloat saturation;
+};
+
struct box_shadow_shader {
GLuint program;
GLint proj;
@@ -153,6 +165,7 @@ struct fx_renderer {
struct box_shadow_shader box_shadow;
struct blur_shader blur1;
struct blur_shader blur2;
+ struct effects_shader blur_effects;
struct corner_shader corner;
struct quad_shader quad;
struct rounded_quad_shader rounded_quad;
@@ -211,7 +224,11 @@ void fx_render_box_shadow(struct fx_renderer *renderer, const struct wlr_box *bo
const float matrix[static 9], int corner_radius, float blur_sigma);
void fx_render_blur(struct fx_renderer *renderer, const float matrix[static 9],
- struct fx_framebuffer **buffer, struct blur_shader *shader, const struct wlr_box *box,
- int blur_radius);
+ struct fx_framebuffer **buffer, struct blur_shader *shader,
+ const struct wlr_box *box, int blur_radius);
+
+void fx_render_blur_effects(struct fx_renderer *renderer, const float matrix[static 9],
+ struct fx_framebuffer **buffer, float blur_noise, float blur_brightness,
+ float blur_contrast, float blur_saturation);
#endif