[MPlayer-dev-eng] [PATCH] libass BorderStyle==3 fix

Rinat ibragimovrinat at mail.ru
Tue Jun 9 12:27:19 CEST 2009


> Ok, I lied :) Clipping is needed here. For normal glyphs it is done in 
> render_glyph().

Everybody lies :)
 
> >
> > > > +	double outline; //outline width
> > >
> > > It's better to add "int border_style" instead. This way you will avoid
> > > comparing floating point values for equality :)
> >
> > I've added 'outline' in same way as 'shadow' (already in code). It's double
> > also, and compared to integer in 'render_text'.
> 
> Right. And it's bad style. Anyway, BorderStyle is orthogonal to outline width, 
> and is not a property of an individual glyph. You can just check 
> render_context.style->BorderStyle directly in render_text() for both outline 
> and shadow bitmaps, or put it in text_info_t and check it from there. In this 
> case you can also keep border and shadow calculation unchanged.
> 

I've reorganized code and new version uses render_glyph() to render background
box so I need not duplicate clipping code.

Added 'bg_box' flag in glyph_info_t. Shadow and outline glyphs are now rendered
only if BorderStyle is set to 1. Added code in render_text() rendering background
box before other glyphs. And code that adds fake glyph bg_box set to 1.


There is still minor bug. Bounding box calculated before text rotation
so background box doesn't cover rotated text.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: libass_BorderStyle_patch_09june.diff
Type: application/octet-stream
Size: 6464 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090609/7600320c/attachment.obj>


More information about the MPlayer-dev-eng mailing list