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 /include/wlr/render/interface.h | |
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 'include/wlr/render/interface.h')
-rw-r--r-- | include/wlr/render/interface.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index 07b26fbc..85a98202 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -48,6 +48,8 @@ struct wlr_renderer_impl { uint32_t (*get_render_buffer_caps)(struct wlr_renderer *renderer); struct wlr_texture *(*texture_from_buffer)(struct wlr_renderer *renderer, struct wlr_buffer *buffer); + struct wlr_render_pass *(*begin_buffer_pass)(struct wlr_renderer *renderer, + struct wlr_buffer *buffer); }; void wlr_renderer_init(struct wlr_renderer *renderer, @@ -62,4 +64,19 @@ struct wlr_texture_impl { void wlr_texture_init(struct wlr_texture *texture, struct wlr_renderer *rendener, const struct wlr_texture_impl *impl, uint32_t width, uint32_t height); +struct wlr_render_pass { + const struct wlr_render_pass_impl *impl; +}; + +void wlr_render_pass_init(struct wlr_render_pass *pass, + const struct wlr_render_pass_impl *impl); + +struct wlr_render_pass_impl { + bool (*submit)(struct wlr_render_pass *pass); + void (*add_texture)(struct wlr_render_pass *pass, + const struct wlr_render_texture_options *options); + void (*add_rect)(struct wlr_render_pass *pass, + const struct wlr_render_rect_options *options); +}; + #endif |