summaryrefslogtreecommitdiffstats
path: root/video/out/gl_osd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-30 14:02:09 +0100
committerwm4 <wm4@nowhere>2015-01-30 15:57:40 +0100
commit697309fc48d6ba9495f9b71eac19cc1c0dbf9690 (patch)
tree56d01762e07872d2d37337b1264a6a904395dcd7 /video/out/gl_osd.c
parent1a26d1a01c8b20edaa25f2c50db67ff4b61a20a8 (diff)
downloadmpv-697309fc48d6ba9495f9b71eac19cc1c0dbf9690.tar.bz2
mpv-697309fc48d6ba9495f9b71eac19cc1c0dbf9690.tar.xz
vo_opengl: use triangle strip for video
A small simplification. Couldn't be done before, because it was also used by the OSD code, which required disjoint quads in a single draw call. Also mess with the unrelated code in gl_osd.c to simplify it a little as well.
Diffstat (limited to 'video/out/gl_osd.c')
-rw-r--r--video/out/gl_osd.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/video/out/gl_osd.c b/video/out/gl_osd.c
index 92d9a9a5ce..117d7feedb 100644
--- a/video/out/gl_osd.c
+++ b/video/out/gl_osd.c
@@ -265,19 +265,13 @@ static struct mpgl_osd_part *mpgl_osd_generate(struct mpgl_osd *ctx,
static void write_quad(struct vertex *va,
float x0, float y0, float x1, float y1,
float tx0, float ty0, float tx1, float ty1,
- float texture_w, float texture_h,
- const uint8_t color[4])
+ float tex_w, float tex_h, const uint8_t color[4])
{
- tx0 /= texture_w;
- ty0 /= texture_h;
- tx1 /= texture_w;
- ty1 /= texture_h;
-
#define COLOR_INIT {color[0], color[1], color[2], color[3]}
- va[0] = (struct vertex) { {x0, y0}, COLOR_INIT, {tx0, ty0} };
- va[1] = (struct vertex) { {x0, y1}, COLOR_INIT, {tx0, ty1} };
- va[2] = (struct vertex) { {x1, y0}, COLOR_INIT, {tx1, ty0} };
- va[3] = (struct vertex) { {x1, y1}, COLOR_INIT, {tx1, ty1} };
+ va[0] = (struct vertex){ {x0, y0}, COLOR_INIT, {tx0 / tex_w, ty0 / tex_h} };
+ va[1] = (struct vertex){ {x0, y1}, COLOR_INIT, {tx0 / tex_w, ty1 / tex_h} };
+ va[2] = (struct vertex){ {x1, y0}, COLOR_INIT, {tx1 / tex_w, ty0 / tex_h} };
+ va[3] = (struct vertex){ {x1, y1}, COLOR_INIT, {tx1 / tex_w, ty1 / tex_h} };
va[4] = va[2];
va[5] = va[1];
#undef COLOR_INIT