summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorErik Reider <[email protected]>2022-11-12 01:38:09 +0100
committerGitHub <[email protected]>2022-11-11 19:38:09 -0500
commit1881b01d3fe1805d371589969b4a75b9cccd8d26 (patch)
tree9fab0420f88fa980e74f90e58d90a0c36952a880 /include
parent8c907a0bcb75d0e2f8629a9c7a73048bf7594e83 (diff)
Per application color saturation support (#21)
* Initial implementation without fullscreen support * Limit saturation to 2 * Fixed saturation not working for fullscreen applications like CSGO * Fixed saturation ignoring border radius * Updated README and sway.5 man page * Rebased from Master * Added command to README * Fixed nitpicks
Diffstat (limited to 'include')
-rw-r--r--include/sway/commands.h1
-rw-r--r--include/sway/desktop/fx_renderer.h5
-rw-r--r--include/sway/tree/container.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h
index 1383295d..6f39c0c8 100644
--- a/include/sway/commands.h
+++ b/include/sway/commands.h
@@ -159,6 +159,7 @@ sway_cmd cmd_new_float;
sway_cmd cmd_new_window;
sway_cmd cmd_nop;
sway_cmd cmd_opacity;
+sway_cmd cmd_saturation;
sway_cmd cmd_new_float;
sway_cmd cmd_new_window;
sway_cmd cmd_no_focus;
diff --git a/include/sway/desktop/fx_renderer.h b/include/sway/desktop/fx_renderer.h
index e3b23411..0bbfcec3 100644
--- a/include/sway/desktop/fx_renderer.h
+++ b/include/sway/desktop/fx_renderer.h
@@ -16,6 +16,7 @@ struct gles2_tex_shader {
GLint size;
GLint position;
GLint radius;
+ GLint saturation;
GLint has_titlebar;
};
@@ -79,10 +80,10 @@ void fx_renderer_scissor(struct wlr_box *box);
bool fx_render_subtexture_with_matrix(struct fx_renderer *renderer, struct wlr_texture *wlr_texture,
const struct wlr_fbox *src_box, const struct wlr_box *dst_box, const float matrix[static 9],
- float alpha, int radius, const bool has_titlebar);
+ float alpha, int radius, float saturation, const bool has_titlebar);
bool fx_render_texture_with_matrix(struct fx_renderer *renderer, struct wlr_texture *wlr_texture,
- const struct wlr_box *dst_box, const float matrix[static 9], float alpha, int radius,
+ const struct wlr_box *dst_box, const float matrix[static 9], float alpha, int radius, float saturation,
const bool has_titlebar);
void fx_render_rect(struct fx_renderer *renderer, const struct wlr_box *box,
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h
index e8aa778a..ebe9568c 100644
--- a/include/sway/tree/container.h
+++ b/include/sway/tree/container.h
@@ -113,6 +113,8 @@ struct sway_container {
// Hidden scratchpad containers have a NULL parent.
bool scratchpad;
+ float saturation;
+
float alpha;
int corner_radius;