diff --git a/render/gles2/pass.c b/render/gles2/pass.c index b10ac047d..f27a6a755 100644 --- a/render/gles2/pass.c +++ b/render/gles2/pass.c @@ -139,7 +139,6 @@ static void set_tex_matrix(GLint loc, enum wl_output_transform trans, wlr_matrix_identity(tex_matrix); wlr_matrix_translate(tex_matrix, box->x, box->y); wlr_matrix_scale(tex_matrix, box->width, box->height); - wlr_matrix_translate(tex_matrix, .5, .5); // since textures have a different origin point we have to transform // differently if we are rotating @@ -148,7 +147,6 @@ static void set_tex_matrix(GLint loc, enum wl_output_transform trans, } else { wlr_matrix_transform(tex_matrix, trans); } - wlr_matrix_translate(tex_matrix, -.5, -.5); glUniformMatrix3fv(loc, 1, GL_FALSE, tex_matrix); } diff --git a/util/matrix.c b/util/matrix.c index 86b434c64..7fdd1fae0 100644 --- a/util/matrix.c +++ b/util/matrix.c @@ -57,21 +57,21 @@ static const float transforms[][9] = { }, [WL_OUTPUT_TRANSFORM_90] = { 0.0f, 1.0f, 0.0f, - -1.0f, 0.0f, 0.0f, + -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, }, [WL_OUTPUT_TRANSFORM_180] = { - -1.0f, 0.0f, 0.0f, - 0.0f, -1.0f, 0.0f, + -1.0f, 0.0f, 1.0f, + 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, }, [WL_OUTPUT_TRANSFORM_270] = { - 0.0f, -1.0f, 0.0f, + 0.0f, -1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, }, [WL_OUTPUT_TRANSFORM_FLIPPED] = { - -1.0f, 0.0f, 0.0f, + -1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, }, @@ -82,12 +82,12 @@ static const float transforms[][9] = { }, [WL_OUTPUT_TRANSFORM_FLIPPED_180] = { 1.0f, 0.0f, 0.0f, - 0.0f, -1.0f, 0.0f, + 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, }, [WL_OUTPUT_TRANSFORM_FLIPPED_270] = { - 0.0f, -1.0f, 0.0f, - -1.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 1.0f, + -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, }, }; @@ -132,9 +132,7 @@ void wlr_matrix_project_box(float mat[static 9], const struct wlr_box *box, wlr_matrix_scale(mat, width, height); if (transform != WL_OUTPUT_TRANSFORM_NORMAL) { - wlr_matrix_translate(mat, 0.5, 0.5); wlr_matrix_transform(mat, transform); - wlr_matrix_translate(mat, -0.5, -0.5); } wlr_matrix_multiply(mat, projection, mat);