From a93fc8afd60646243ee635b443fc2a17e2d97a18 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 2 May 2023 21:32:51 +0200 Subject: render: introduce blend mode Allow callers to pick the blend mode when rendering a rect. The "none" mode can be used to disable blending and clear rects. --- include/wlr/render/wlr_renderer.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/wlr/render') diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h index f6b58df5..33668067 100644 --- a/include/wlr/render/wlr_renderer.h +++ b/include/wlr/render/wlr_renderer.h @@ -177,6 +177,16 @@ struct wlr_render_pass *wlr_renderer_begin_buffer_pass( */ bool wlr_render_pass_submit(struct wlr_render_pass *render_pass); +/** + * Blend modes. + */ +enum wlr_render_blend_mode { + /* Pre-multiplied alpha (default) */ + WLR_RENDER_BLEND_MODE_PREMULTIPLIED, + /* Blending is disabled */ + WLR_RENDER_BLEND_MODE_NONE, +}; + struct wlr_render_texture_options { /* Source texture */ struct wlr_texture *texture; @@ -215,6 +225,8 @@ struct wlr_render_rect_options { struct wlr_render_color color; /* Clip region, leave NULL to disable clipping */ const pixman_region32_t *clip; + /* Blend mode */ + enum wlr_render_blend_mode blend_mode; }; /** -- cgit v1.2.3