|
|
@ -180,8 +180,13 @@ static bool wlr_gles2_render_texture_with_matrix(
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// OpenGL ES 2 requires the glUniformMatrix3fv transpose parameter to be set
|
|
|
|
|
|
|
|
// to GL_FALSE
|
|
|
|
|
|
|
|
float transposition[9];
|
|
|
|
|
|
|
|
wlr_matrix_transpose(transposition, matrix);
|
|
|
|
|
|
|
|
|
|
|
|
wlr_texture_bind(texture);
|
|
|
|
wlr_texture_bind(texture);
|
|
|
|
GL_CALL(glUniformMatrix3fv(0, 1, GL_TRUE, matrix));
|
|
|
|
GL_CALL(glUniformMatrix3fv(0, 1, GL_FALSE, transposition));
|
|
|
|
GL_CALL(glUniform1i(1, texture->inverted_y));
|
|
|
|
GL_CALL(glUniform1i(1, texture->inverted_y));
|
|
|
|
GL_CALL(glUniform1f(3, alpha));
|
|
|
|
GL_CALL(glUniform1f(3, alpha));
|
|
|
|
draw_quad();
|
|
|
|
draw_quad();
|
|
|
@ -191,16 +196,26 @@ static bool wlr_gles2_render_texture_with_matrix(
|
|
|
|
|
|
|
|
|
|
|
|
static void wlr_gles2_render_quad(struct wlr_renderer *wlr_renderer,
|
|
|
|
static void wlr_gles2_render_quad(struct wlr_renderer *wlr_renderer,
|
|
|
|
const float color[static 4], const float matrix[static 9]) {
|
|
|
|
const float color[static 4], const float matrix[static 9]) {
|
|
|
|
|
|
|
|
// OpenGL ES 2 requires the glUniformMatrix3fv transpose parameter to be set
|
|
|
|
|
|
|
|
// to GL_FALSE
|
|
|
|
|
|
|
|
float transposition[9];
|
|
|
|
|
|
|
|
wlr_matrix_transpose(transposition, matrix);
|
|
|
|
|
|
|
|
|
|
|
|
GL_CALL(glUseProgram(shaders.quad));
|
|
|
|
GL_CALL(glUseProgram(shaders.quad));
|
|
|
|
GL_CALL(glUniformMatrix3fv(0, 1, GL_TRUE, matrix));
|
|
|
|
GL_CALL(glUniformMatrix3fv(0, 1, GL_FALSE, transposition));
|
|
|
|
GL_CALL(glUniform4f(1, color[0], color[1], color[2], color[3]));
|
|
|
|
GL_CALL(glUniform4f(1, color[0], color[1], color[2], color[3]));
|
|
|
|
draw_quad();
|
|
|
|
draw_quad();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void wlr_gles2_render_ellipse(struct wlr_renderer *wlr_renderer,
|
|
|
|
static void wlr_gles2_render_ellipse(struct wlr_renderer *wlr_renderer,
|
|
|
|
const float color[static 4], const float matrix[static 9]) {
|
|
|
|
const float color[static 4], const float matrix[static 9]) {
|
|
|
|
|
|
|
|
// OpenGL ES 2 requires the glUniformMatrix3fv transpose parameter to be set
|
|
|
|
|
|
|
|
// to GL_FALSE
|
|
|
|
|
|
|
|
float transposition[9];
|
|
|
|
|
|
|
|
wlr_matrix_transpose(transposition, matrix);
|
|
|
|
|
|
|
|
|
|
|
|
GL_CALL(glUseProgram(shaders.ellipse));
|
|
|
|
GL_CALL(glUseProgram(shaders.ellipse));
|
|
|
|
GL_CALL(glUniformMatrix3fv(0, 1, GL_TRUE, matrix));
|
|
|
|
GL_CALL(glUniformMatrix3fv(0, 1, GL_FALSE, transposition));
|
|
|
|
GL_CALL(glUniform4f(1, color[0], color[1], color[2], color[3]));
|
|
|
|
GL_CALL(glUniform4f(1, color[0], color[1], color[2], color[3]));
|
|
|
|
draw_quad();
|
|
|
|
draw_quad();
|
|
|
|
}
|
|
|
|
}
|
|
|
|