summaryrefslogtreecommitdiffstats
path: root/libass/ass_bitmap.c
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-17 15:32:01 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-17 15:32:01 +0000
commitca88c0a342b7c89a22fb0088639c1a1db075bc7f (patch)
tree3aba02321a036b289d88be7282647bf48ee42a2b /libass/ass_bitmap.c
parentea439208cc34065d32ca630fac6877f3cd1d6564 (diff)
downloadlibass-ca88c0a342b7c89a22fb0088639c1a1db075bc7f.tar.bz2
libass-ca88c0a342b7c89a22fb0088639c1a1db075bc7f.tar.xz
Reduce code duplication in init_render_context().
Don't use glyph stroker for borderless glyphs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19879 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass/ass_bitmap.c')
-rw-r--r--libass/ass_bitmap.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c
index a2ab88e..4906fd0 100644
--- a/libass/ass_bitmap.c
+++ b/libass/ass_bitmap.c
@@ -182,31 +182,34 @@ int glyph_to_bitmap(ass_synth_priv_t* priv, FT_Glyph glyph, FT_Glyph outline_gly
{
const int bord = ceil(blur_radius);
- assert(bm_g);
+ assert(bm_g && bm_o);
if (glyph)
*bm_g = glyph_to_bitmap_internal(glyph, bord);
+ else
+ *bm_g = 0;
if (!*bm_g)
return 1;
- if (outline_glyph && bm_o) {
+ if (outline_glyph) {
*bm_o = glyph_to_bitmap_internal(outline_glyph, bord);
if (!*bm_o) {
ass_free_bitmap(*bm_g);
return 1;
}
- }
+ } else
+ *bm_o = 0;
- if (bm_o)
+ if (*bm_o)
resize_tmp(priv, (*bm_o)->w, (*bm_o)->h);
resize_tmp(priv, (*bm_g)->w, (*bm_g)->h);
if (be) {
blur((*bm_g)->buffer, priv->tmp, (*bm_g)->w, (*bm_g)->h, (*bm_g)->w, (int*)priv->gt2, priv->g_r, priv->g_w);
- if (bm_o)
+ if (*bm_o)
blur((*bm_o)->buffer, priv->tmp, (*bm_o)->w, (*bm_o)->h, (*bm_o)->w, (int*)priv->gt2, priv->g_r, priv->g_w);
}
- if (bm_o)
+ if (*bm_o)
fix_outline(*bm_g, *bm_o);
return 0;