mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
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
This commit is contained in:
parent
17ad034480
commit
756dedae20
5 changed files with 126 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue