summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-28 18:07:18 +0200
committerwm4 <wm4@nowhere>2016-03-28 18:07:18 +0200
commitb8b2a465d10e64aff370ca8406f65832d0f64fed (patch)
tree71f1d54bc8e094cdae9ed3e2a78e344b9bfd14e9
parent5827d9cc090484cd4c55753a912d05f98a4a0444 (diff)
downloadmpv-b8b2a465d10e64aff370ca8406f65832d0f64fed.tar.bz2
mpv-b8b2a465d10e64aff370ca8406f65832d0f64fed.tar.xz
vo_opengl: reduce temporary variables in gl_transform_trans()
Using a single gl_transform variable instead of many float ones makes it easier to see what it's doing. No functional change.
-rw-r--r--video/out/opengl/utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c
index f88cd4374a..287d9aee4a 100644
--- a/video/out/opengl/utils.c
+++ b/video/out/opengl/utils.c
@@ -480,11 +480,11 @@ void gl_transform_ortho(struct gl_transform *t, float x0, float x1,
// process. In other words: post-composes t onto x
void gl_transform_trans(struct gl_transform t, struct gl_transform *x)
{
- float x00 = x->m[0][0], x01 = x->m[0][1], x10 = x->m[1][0], x11 = x->m[1][1];
- x->m[0][0] = t.m[0][0] * x00 + t.m[0][1] * x10;
- x->m[1][0] = t.m[1][0] * x00 + t.m[1][1] * x10;
- x->m[0][1] = t.m[0][0] * x01 + t.m[0][1] * x11;
- x->m[1][1] = t.m[1][0] * x01 + t.m[1][1] * x11;
+ struct gl_transform xt = *x;
+ x->m[0][0] = t.m[0][0] * xt.m[0][0] + t.m[0][1] * xt.m[1][0];
+ x->m[1][0] = t.m[1][0] * xt.m[0][0] + t.m[1][1] * xt.m[1][0];
+ x->m[0][1] = t.m[0][0] * xt.m[0][1] + t.m[0][1] * xt.m[1][1];
+ x->m[1][1] = t.m[1][0] * xt.m[0][1] + t.m[1][1] * xt.m[1][1];
gl_transform_vec(t, &x->t[0], &x->t[1]);
}