diff options
author | Erik Reider <[email protected]> | 2024-01-02 01:19:48 +0100 |
---|---|---|
committer | Erik Reider <[email protected]> | 2024-01-04 02:11:25 +0100 |
commit | c15af4a182314d8384fc6b28e7c3fc58c0352b83 (patch) | |
tree | 841c17acede5ead7b8c08c9668d0b148ad5c26e4 /include/render | |
parent | 1a6918f948be034e65c50af8969d090b5e762dc1 (diff) |
Added back shadow effect
Diffstat (limited to 'include/render')
-rw-r--r-- | include/render/fx_renderer/fx_renderer.h | 13 | ||||
-rw-r--r-- | include/render/fx_renderer/shaders.h | 8 | ||||
-rw-r--r-- | include/render/pass.h | 15 |
3 files changed, 17 insertions, 19 deletions
diff --git a/include/render/fx_renderer/fx_renderer.h b/include/render/fx_renderer/fx_renderer.h index d62d6b4..4d99866 100644 --- a/include/render/fx_renderer/fx_renderer.h +++ b/include/render/fx_renderer/fx_renderer.h @@ -177,19 +177,6 @@ void push_fx_debug_(struct fx_renderer *renderer, #define push_fx_debug(renderer) push_fx_debug_(renderer, _WLR_FILENAME, __func__) void pop_fx_debug(struct fx_renderer *renderer); -// Initialize the stenciling work -void fx_renderer_stencil_mask_init(void); - -// Close the mask -void fx_renderer_stencil_mask_close(bool draw_inside_mask); - -// Finish stenciling and clear the buffer -void fx_renderer_stencil_mask_fini(void); - -void fx_renderer_stencil_enable(void); - -void fx_renderer_stencil_disable(void); - /// /// Render Timer /// diff --git a/include/render/fx_renderer/shaders.h b/include/render/fx_renderer/shaders.h index 584b18e..92a14d5 100644 --- a/include/render/fx_renderer/shaders.h +++ b/include/render/fx_renderer/shaders.h @@ -42,24 +42,20 @@ struct tex_shader { struct stencil_mask_shader { GLuint program; GLint proj; - GLint tex_proj; - GLint tex; + GLint color; GLint pos_attrib; GLint half_size; GLint position; - GLint color; GLint radius; }; struct box_shadow_shader { GLuint program; GLint proj; - GLint tex_proj; - GLint tex; + GLint color; GLint pos_attrib; GLint position; GLint size; - GLint color; GLint blur_sigma; GLint corner_radius; }; diff --git a/include/render/pass.h b/include/render/pass.h index 9551f81..ec38a73 100644 --- a/include/render/pass.h +++ b/include/render/pass.h @@ -5,6 +5,7 @@ #include <wlr/render/pass.h> #include <wlr/util/box.h> #include <wlr/render/interface.h> +#include "types/fx/shadow_data.h" struct fx_gles_render_pass { struct wlr_render_pass base; @@ -24,6 +25,7 @@ struct fx_gles_render_pass *fx_renderer_begin_buffer_pass(struct wlr_renderer *r struct fx_render_texture_options { struct wlr_render_texture_options base; + struct wlr_box *clip_box; // Used to clip csd. Ignored if NULL int corner_radius; }; @@ -49,4 +51,17 @@ void fx_render_pass_add_texture(struct fx_gles_render_pass *render_pass, void fx_render_pass_add_rect(struct fx_gles_render_pass *render_pass, const struct fx_render_rect_options *options); +/** + * Render a stencil mask. + */ +void fx_render_pass_add_stencil_mask(struct fx_gles_render_pass *pass, + const struct fx_render_rect_options *fx_options, int corner_radius); + +/** + * Render a box shadow. + */ +void fx_render_pass_add_box_shadow(struct fx_gles_render_pass *pass, + const struct fx_render_rect_options *fx_options, + int corner_radius, struct shadow_data *shadow_data); + #endif |