mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
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.
This commit is contained in:
parent
6b7d1d732a
commit
a93fc8afd6
3 changed files with 34 additions and 2 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue