diff options
author | Simon Ser <contact@emersion.fr> | 2023-05-02 21:32:51 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-05-02 21:32:51 +0200 |
commit | a93fc8afd60646243ee635b443fc2a17e2d97a18 (patch) | |
tree | f0336118d0f2b2312bf0886c836ca82a718d2c96 /include/wlr/render | |
parent | 6b7d1d732ab5c548480729ef3c227a71c7b18a89 (diff) |
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.
Diffstat (limited to 'include/wlr/render')
-rw-r--r-- | include/wlr/render/wlr_renderer.h | 12 |
1 files changed, 12 insertions, 0 deletions
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; }; /** |