Merge pull request #659 from agx/alpha

Make wlr_render_with_matrix use alpha
This commit is contained in:
Drew DeVault 2018-02-25 13:16:35 -05:00 committed by GitHub
commit 3296365ce5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 55 additions and 22 deletions

View file

@ -33,12 +33,13 @@ struct wlr_texture *wlr_render_texture_create(struct wlr_renderer *r);
* float projection[16];
* float matrix[16];
* wlr_texture_get_matrix(texture, &matrix, &projection, 123, 321);
* wlr_render_with_matrix(renderer, texture, &matrix);
* wlr_render_with_matrix(renderer, texture, &matrix, 0.5f);
*
* This will render the texture at <123, 321>.
* This will render the texture at <123, 321> with an alpha channel of 0.5.
*/
bool wlr_render_with_matrix(struct wlr_renderer *r,
struct wlr_texture *texture, const float (*matrix)[16]);
struct wlr_texture *texture, const float (*matrix)[16], float alpha);
/**
* Renders a solid quad in the specified color.
*/

View file

@ -22,7 +22,7 @@ struct wlr_renderer_impl {
void (*scissor)(struct wlr_renderer *renderer, struct wlr_box *box);
struct wlr_texture *(*texture_create)(struct wlr_renderer *renderer);
bool (*render_with_matrix)(struct wlr_renderer *renderer,
struct wlr_texture *texture, const float (*matrix)[16]);
struct wlr_texture *texture, const float (*matrix)[16], float alpha);
void (*render_quad)(struct wlr_renderer *renderer,
const float (*color)[4], const float (*matrix)[16]);
void (*render_ellipse)(struct wlr_renderer *renderer,