diff options
author | Simon Ser <contact@emersion.fr> | 2022-06-21 22:39:29 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-04-25 17:25:10 +0200 |
commit | 756dedae20eead72af6cfc7f724d0b2af6597eeb (patch) | |
tree | 219cc22f7ea39667cd71213cae5fe920c621bc9d /render/pass.c | |
parent | 17ad03448082f525fef515c4c45f56d151bbc46a (diff) |
Add a new renderer API
Goals:
- Extensibility: we need to be able to add new params to the calls
to render a texture/rect. For instance we'll need to add fences to
the render texture operation for explicit sync purposes.
- No implicit state: no more bind_buffer, begin, end.
- No matrices: these hurt Pixman and we don't need them.
- Clip regions for optimized damage repainting.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3188
Diffstat (limited to 'render/pass.c')
-rw-r--r-- | render/pass.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/render/pass.c b/render/pass.c new file mode 100644 index 00000000..c1b88b8d --- /dev/null +++ b/render/pass.c @@ -0,0 +1,25 @@ +#include <assert.h> +#include <string.h> +#include <wlr/render/interface.h> +#include <wlr/render/wlr_renderer.h> + +void wlr_render_pass_init(struct wlr_render_pass *render_pass, + const struct wlr_render_pass_impl *impl) { + assert(impl->submit && impl->add_texture && impl->add_rect); + memset(render_pass, 0, sizeof(*render_pass)); + render_pass->impl = impl; +} + +bool wlr_render_pass_submit(struct wlr_render_pass *render_pass) { + return render_pass->impl->submit(render_pass); +} + +void wlr_render_pass_add_texture(struct wlr_render_pass *render_pass, + const struct wlr_render_texture_options *options) { + render_pass->impl->add_texture(render_pass, options); +} + +void wlr_render_pass_add_rect(struct wlr_render_pass *render_pass, + const struct wlr_render_rect_options *options) { + render_pass->impl->add_rect(render_pass, options); +} |