aboutsummaryrefslogtreecommitdiff
path: root/render/matrix.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-01 09:15:33 +0100
committeremersion <contact@emersion.fr>2017-12-01 09:15:33 +0100
commit6a69b4419fa25f4bbcbe3253ed000276cb6ace42 (patch)
tree94fe7d78224ba54e0be35cc6941fe9cb5c6526b3 /render/matrix.c
parentf4754ad1a21eaede20f6e9c5d4e0c78294119cc1 (diff)
Make wlr_output_transform_* functions public, refactoring
Diffstat (limited to 'render/matrix.c')
-rw-r--r--render/matrix.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/render/matrix.c b/render/matrix.c
index 8a3352e0..6118e6a5 100644
--- a/render/matrix.c
+++ b/render/matrix.c
@@ -86,35 +86,35 @@ void wlr_matrix_mul(const float (*x)[16], const float (*y)[16], float (*product)
static const float transforms[][4] = {
[WL_OUTPUT_TRANSFORM_NORMAL] = {
1.0f, 0.0f,
- 0.0f, -1.0f,
+ 0.0f, 1.0f,
},
[WL_OUTPUT_TRANSFORM_90] = {
0.0f, -1.0f,
- -1.0f, 0.0f,
+ 1.0f, 0.0f,
},
[WL_OUTPUT_TRANSFORM_180] = {
-1.0f, 0.0f,
- 0.0f, 1.0f,
+ 0.0f, -1.0f,
},
[WL_OUTPUT_TRANSFORM_270] = {
0.0f, 1.0f,
- 1.0f, 0.0f,
+ -1.0f, 0.0f,
},
[WL_OUTPUT_TRANSFORM_FLIPPED] = {
-1.0f, 0.0f,
- 0.0f, -1.0f,
+ 0.0f, 1.0f,
},
[WL_OUTPUT_TRANSFORM_FLIPPED_90] = {
0.0f, 1.0f,
- -1.0f, 0.0f,
+ 1.0f, 0.0f,
},
[WL_OUTPUT_TRANSFORM_FLIPPED_180] = {
1.0f, 0.0f,
- 0.0f, 1.0f,
+ 0.0f, -1.0f,
},
[WL_OUTPUT_TRANSFORM_FLIPPED_270] = {
0.0f, -1.0f,
- 1.0f, 0.0f,
+ -1.0f, 0.0f,
},
};
@@ -124,11 +124,11 @@ void wlr_matrix_transform(float mat[static 16],
const float *t = transforms[transform];
- // Rotation + relection
+ // Rotation + reflection
mat[0] = t[0];
mat[1] = t[1];
- mat[4] = -t[2];
- mat[5] = -t[3];
+ mat[4] = t[2];
+ mat[5] = t[3];
// Identity
mat[10] = 1.0f;
@@ -144,11 +144,11 @@ void wlr_matrix_texture(float mat[static 16], int32_t width, int32_t height,
float x = 2.0f / width;
float y = 2.0f / height;
- // Rotation + relection
+ // Rotation + reflection
mat[0] = x * t[0];
mat[1] = x * t[1];
- mat[4] = y * t[2];
- mat[5] = y * t[3];
+ mat[4] = y * -t[2];
+ mat[5] = y * -t[3];
// Translation
mat[3] = -copysign(1.0f, mat[0] + mat[1]);