From 51c7078b9ec413ebd8316501f01ccf769a090f64 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Sun, 31 Dec 2023 00:32:39 +0100 Subject: Converted fx_renderer to impl wlr_renderer Makes the fx_renderer the default renderer for everything, no wlr_gles2 rendering. This includes wlr_render_pass (fx_render_pass in our case) --- include/render/pass.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 include/render/pass.h (limited to 'include/render/pass.h') diff --git a/include/render/pass.h b/include/render/pass.h new file mode 100644 index 0000000..9551f81 --- /dev/null +++ b/include/render/pass.h @@ -0,0 +1,52 @@ +#ifndef FX_RENDER_PASS_H +#define FX_RENDER_PASS_H + +#include +#include +#include +#include + +struct fx_gles_render_pass { + struct wlr_render_pass base; + struct fx_framebuffer *buffer; + float projection_matrix[9]; + struct fx_render_timer *timer; +}; + +/** + * Begin a new render pass with the supplied destination buffer. + * + * Callers must call wlr_render_pass_submit() once they are done with the + * render pass. + */ +struct fx_gles_render_pass *fx_renderer_begin_buffer_pass(struct wlr_renderer *renderer, + struct wlr_buffer *buffer, const struct wlr_buffer_pass_options *options); + +struct fx_render_texture_options { + struct wlr_render_texture_options base; + int corner_radius; +}; + +struct fx_render_texture_options fx_render_texture_options_default( + const struct wlr_render_texture_options *base); + +struct fx_render_rect_options { + struct wlr_render_rect_options base; +}; + +struct fx_render_rect_options fx_render_rect_options_default( + const struct wlr_render_rect_options *base); + +/** + * Render a fx texture. + */ +void fx_render_pass_add_texture(struct fx_gles_render_pass *render_pass, + const struct fx_render_texture_options *options); + +/** + * Render a rectangle. + */ +void fx_render_pass_add_rect(struct fx_gles_render_pass *render_pass, + const struct fx_render_rect_options *options); + +#endif -- cgit v1.2.3 From c15af4a182314d8384fc6b28e7c3fc58c0352b83 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Tue, 2 Jan 2024 01:19:48 +0100 Subject: Added back shadow effect --- include/render/pass.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/render/pass.h') 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 #include #include +#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 -- cgit v1.2.3 From b392638c8a8d142376fa0f44b3cc0f3a6ebd93f3 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Wed, 3 Jan 2024 23:50:21 +0100 Subject: Fixed scaling issues --- include/render/pass.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/render/pass.h') diff --git a/include/render/pass.h b/include/render/pass.h index ec38a73..05bf1e9 100644 --- a/include/render/pass.h +++ b/include/render/pass.h @@ -25,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; + float scale; struct wlr_box *clip_box; // Used to clip csd. Ignored if NULL int corner_radius; }; @@ -34,6 +35,7 @@ struct fx_render_texture_options fx_render_texture_options_default( struct fx_render_rect_options { struct wlr_render_rect_options base; + float scale; }; struct fx_render_rect_options fx_render_rect_options_default( -- cgit v1.2.3