Mercurial > mplayer.hg
changeset 34839:5e29e950d918
Do not needlessly modulate the texture color with the vertex color.
Might give some speedup on not-so-intelligent GL implementations
that also have very little compute power.
author | reimar |
---|---|
date | Sun, 20 May 2012 15:30:01 +0000 |
parents | 716f2ddf8773 |
children | 8dd474c27a8d |
files | libvo/vo_gl.c libvo/vo_gl2.c |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_gl.c Sun May 20 09:01:01 2012 +0000 +++ b/libvo/vo_gl.c Sun May 20 15:30:01 2012 +0000 @@ -552,7 +552,7 @@ mpglEnable(gl_target); if (mpglDrawBuffer) mpglDrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT); - mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); mp_msg(MSGT_VO, MSGL_V, "[gl] Creating %dx%d texture...\n", texture_width, texture_height); @@ -805,6 +805,8 @@ mpglPushMatrix(); mpglLoadMatrixf(matrix); } + if (osd_color != 0xffffff) + mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); mpglEnable(GL_BLEND); if (draw_eosd) { mpglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -822,6 +824,8 @@ } // set rendering parameters back to defaults mpglDisable(GL_BLEND); + if (osd_color != 0xffffff) + mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); if (!scaled_osd) mpglPopMatrix(); mpglBindTexture(gl_target, 0);
--- a/libvo/vo_gl2.c Sun May 20 09:01:01 2012 +0000 +++ b/libvo/vo_gl2.c Sun May 20 15:30:01 2012 +0000 @@ -272,7 +272,7 @@ glCreateClearTex(GL_TEXTURE_2D, gl_internal_format, gl_bitmap_format, gl_bitmap_type, GL_LINEAR, texture_width, texture_height, 0); - glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); if (is_yuv) { int xs, ys, depth; int chroma_clear_val = 128;