vo_vdpau: change how OSD is rendered
commitdcdc8b433b2e3426f83337b6e1bfcb8956a01723
authorUoti Urpala <uau@mplayer2.org>
Mon, 27 Aug 2012 19:22:11 +0000 (27 22:22 +0300)
committerUoti Urpala <uau@mplayer2.org>
Fri, 31 Aug 2012 17:30:42 +0000 (31 20:30 +0300)
tree120f10711bbf530372d4643eb062a72f90e70815
parentfb0c6347c803c09b97adbb6cd0484b235967739e
vo_vdpau: change how OSD is rendered

When processing OSD bitmaps, the OSD rendering code in vo_vdpau first
uploaded them to an output surface identical to main video display
surfaces, and then blended them from there. Change the code to instead
pack them into an alpha-only surface which is only resized to be
larger if necessary. The main benefit is using less video memory -
a smaller alpha-only surface instead of a fullscreen RGBA surface.

The code currently doesn't keep the bitmaps over multiple OSD calls,
so the packing isn't actually beneficial at the moment (they could
just as well be individually uploaded to and rendered from one shared
area). The code relies on some assumptions about the behavior of the
old OSD code: there can't be more than 6 separate bitmaps, and the
bitmaps provided in the draw callbacks are still valid after the call.

Since main OSD rendering uses libass now, just rendering the libass
bitmaps directly (instead of improving the rendering of the old-style
results generated from them) would be an alternative. However, not all
the OSD types are trivial to convert, and this change moves in a
direction which should help such future changes.
libvo/vo_vdpau.c