Mercurial > mplayer.hg
comparison libvo/vo_gl.c @ 35445:19c56dc40a51
Fix alpha for ASS subtitles.
EOSD always needs to use MODULATE since the vertex colour
might contain alpha.
author | reimar |
---|---|
date | Fri, 30 Nov 2012 20:51:02 +0000 |
parents | 67de02ade8af |
children | 92ec362e0737 |
comparison
equal
deleted
inserted
replaced
35444:4644c320daf4 | 35445:19c56dc40a51 |
---|---|
822 }; | 822 }; |
823 mpglMatrixMode(GL_PROJECTION); | 823 mpglMatrixMode(GL_PROJECTION); |
824 mpglPushMatrix(); | 824 mpglPushMatrix(); |
825 mpglLoadMatrixf(matrix); | 825 mpglLoadMatrixf(matrix); |
826 } | 826 } |
827 if (osd_color != 0xffffff) | |
828 mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | |
829 mpglEnable(GL_BLEND); | 827 mpglEnable(GL_BLEND); |
830 if (draw_eosd) { | 828 if (draw_eosd) { |
829 mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | |
831 mpglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 830 mpglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
832 mpglCallList(eosdDispList); | 831 mpglCallList(eosdDispList); |
832 mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); | |
833 } | 833 } |
834 if (draw_osd) { | 834 if (draw_osd) { |
835 if (osd_color != 0xffffff) | |
836 mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | |
835 mpglColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24)); | 837 mpglColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24)); |
836 // draw OSD | 838 // draw OSD |
837 #ifndef FAST_OSD | 839 #ifndef FAST_OSD |
838 // render alpha | 840 // render alpha |
839 mpglBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); | 841 mpglBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); |
848 for (i = 0; i < osdtexCnt; i++) { | 850 for (i = 0; i < osdtexCnt; i++) { |
849 struct osdcoords *c = osdcoords + i; | 851 struct osdcoords *c = osdcoords + i; |
850 mpglBindTexture(gl_target, osdtex[i]); | 852 mpglBindTexture(gl_target, osdtex[i]); |
851 glDrawTex(c->x, c->y, c->w, c->h, 0, 0, c->w, c->h, c->sx, c->sy, using_tex_rect, 0, 0, 0); | 853 glDrawTex(c->x, c->y, c->w, c->h, 0, 0, c->w, c->h, c->sx, c->sy, using_tex_rect, 0, 0, 0); |
852 } | 854 } |
855 if (osd_color != 0xffffff) | |
856 mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); | |
853 } | 857 } |
854 // set rendering parameters back to defaults | 858 // set rendering parameters back to defaults |
855 mpglDisable(GL_BLEND); | 859 mpglDisable(GL_BLEND); |
856 if (osd_color != 0xffffff) | |
857 mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); | |
858 if (!scaled_osd) | 860 if (!scaled_osd) |
859 mpglPopMatrix(); | 861 mpglPopMatrix(); |
860 mpglBindTexture(gl_target, 0); | 862 mpglBindTexture(gl_target, 0); |
861 } | 863 } |
862 | 864 |