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
commit75cc0a6fc81c140a909c9c82c709382070b8ba1d (patch)
tree8de4e9e4b43b02f14d726c00e4b0f69133642f46 /libass/ass_bitmap.c
parent51cd63eb1ce54742e942942e0604bbc974a4c0cb (diff)
downloadmpv-75cc0a6fc81c140a909c9c82c709382070b8ba1d.tar.bz2
mpv-75cc0a6fc81c140a909c9c82c709382070b8ba1d.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 a2ab88e8d4..4906fd0944 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;