aboutsummaryrefslogtreecommitdiff
path: root/render/gles2
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-06-07 23:13:33 +0200
committerIsaac Freund <mail@isaacfreund.com>2022-06-08 19:27:36 +0000
commitc2e046022f36001fd2b9fd369ac14acf73a20e23 (patch)
tree9187e46df4a2b8db9b51837f06c7a081d080f22b /render/gles2
parentc2e4ba1dd092ac8dcd393c6f9ab317fcd3a8dce6 (diff)
render/gles2: simplify flipped projection
Instead of computing the projection, then flipping, just provide the correct transform to wlr_matrix_projection().
Diffstat (limited to 'render/gles2')
-rw-r--r--render/gles2/renderer.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index e7bfe0e0..c47081ae 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -204,7 +204,7 @@ static void gles2_begin(struct wlr_renderer *wlr_renderer, uint32_t width,
// refresh projection matrix
wlr_matrix_projection(renderer->projection, width, height,
- WL_OUTPUT_TRANSFORM_NORMAL);
+ WL_OUTPUT_TRANSFORM_FLIPPED_180);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
@@ -245,12 +245,6 @@ static void gles2_scissor(struct wlr_renderer *wlr_renderer,
pop_gles2_debug(renderer);
}
-static const float flip_180[9] = {
- 1.0f, 0.0f, 0.0f,
- 0.0f, -1.0f, 0.0f,
- 0.0f, 0.0f, 1.0f,
-};
-
static bool gles2_render_subtexture_with_matrix(
struct wlr_renderer *wlr_renderer, struct wlr_texture *wlr_texture,
const struct wlr_fbox *box, const float matrix[static 9],
@@ -286,7 +280,6 @@ static bool gles2_render_subtexture_with_matrix(
float gl_matrix[9];
wlr_matrix_multiply(gl_matrix, renderer->projection, matrix);
- wlr_matrix_multiply(gl_matrix, flip_180, gl_matrix);
// OpenGL ES 2 requires the glUniformMatrix3fv transpose parameter to be set
// to GL_FALSE
@@ -346,7 +339,6 @@ static void gles2_render_quad_with_matrix(struct wlr_renderer *wlr_renderer,
float gl_matrix[9];
wlr_matrix_multiply(gl_matrix, renderer->projection, matrix);
- wlr_matrix_multiply(gl_matrix, flip_180, gl_matrix);
// OpenGL ES 2 requires the glUniformMatrix3fv transpose parameter to be set
// to GL_FALSE