aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-25 13:16:35 -0500
committerGitHub <noreply@github.com>2018-02-25 13:16:35 -0500
commit3296365ce591ae4ba115befa8134bc2526b36710 (patch)
treee1b7a73b6d86e69b356bc8791a0b0996fa2842ad /render
parent7da653bbb4569d41ce1a46c97e3b10c675f73741 (diff)
parent202a728ee9a0e7dbfbcc7e51e060a2a9a5f09847 (diff)
Merge pull request #659 from agx/alpha
Make wlr_render_with_matrix use alpha
Diffstat (limited to 'render')
-rw-r--r--render/gles2/renderer.c6
-rw-r--r--render/wlr_renderer.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 81a932e6..ad739cf8 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -171,7 +171,7 @@ static void draw_quad() {
}
static bool wlr_gles2_render_texture(struct wlr_renderer *wlr_renderer,
- struct wlr_texture *texture, const float (*matrix)[16]) {
+ struct wlr_texture *texture, const float (*matrix)[16], float alpha) {
if (!texture || !texture->valid) {
wlr_log(L_ERROR, "attempt to render invalid texture");
return false;
@@ -179,12 +179,12 @@ static bool wlr_gles2_render_texture(struct wlr_renderer *wlr_renderer,
wlr_texture_bind(texture);
GL_CALL(glUniformMatrix4fv(0, 1, GL_FALSE, *matrix));
- // TODO: source alpha from somewhere else I guess
- GL_CALL(glUniform1f(2, 1.0f));
+ GL_CALL(glUniform1f(2, alpha));
draw_quad();
return true;
}
+
static void wlr_gles2_render_quad(struct wlr_renderer *wlr_renderer,
const float (*color)[4], const float (*matrix)[16]) {
GL_CALL(glUseProgram(shaders.quad));
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index fa6c6fc3..ce8fbe36 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -36,8 +36,8 @@ struct wlr_texture *wlr_render_texture_create(struct wlr_renderer *r) {
}
bool wlr_render_with_matrix(struct wlr_renderer *r,
- struct wlr_texture *texture, const float (*matrix)[16]) {
- return r->impl->render_with_matrix(r, texture, matrix);
+ struct wlr_texture *texture, const float (*matrix)[16], float alpha) {
+ return r->impl->render_with_matrix(r, texture, matrix, alpha);
}
void wlr_render_colored_quad(struct wlr_renderer *r,