vo_gl: use a single texture for libass-rendered bitmaps
commit674a1625f99ab6e8db988430e9285b3dac2ff5d1
authorwm4 <wm4@mplayer2.org>
Sat, 29 Oct 2011 17:38:33 +0000 (29 19:38 +0200)
committerUoti Urpala <uau@mplayer2.org>
Fri, 31 Aug 2012 17:30:42 +0000 (31 20:30 +0300)
treef10360694de8486d3822eb71b234e4fdccc158fb
parent89a0e4729a81a3e5a59cf07f677179067ea3d1b4
vo_gl: use a single texture for libass-rendered bitmaps

Use the bitmap packer code split from vo_vdpau to pack all
libass-generated subtitle bitmaps into one texture. This reportedly
improves performance in a lot in some cases on OS X at least.

One issue with the old code was that "large" images caused each
sub-image to be created and rendered as a new texture. "Large" in this
case means larger than 32x32 pixels, which actually isn't very large
with screen sizes beyond 1500x1000 pixels. This means rendering a
simple subtitle for a fullscreened video may allocate many small
textures, one for each glyph.

The new code also uses less deprecated OpenGL features and draws all
sub-images in one batch.

There are two possible issues the new code could cause:
- Drivers could have performance issues with the larger texture sizes
  and the number of glTexSubImage2D calls on it.
- There is only one EOSD texture, which could become full (the size
  is increased on demand, but that is restricted by driver texture
  size limitations).

Modified by Uoti Urpala to work with a different bitmap packer
interface than the commit was originally created against.
libvo/gl_common.c
libvo/gl_common.h
libvo/vo_gl.c