From: Grigori Goronzy Date: Tue, 1 Sep 2009 00:39:51 +0000 (+0200) Subject: opaque box: do not subtract glyph from border X-Git-Tag: 0.9.8~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4e0ac252792981699532c4076569946c9719999;p=libass opaque box: do not subtract glyph from border Similar to VSFilter, do not subtract the glyph bitmap from the border bitmap when BorderStyle 3 is used. --- diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index e2018ce..1ae2d7c 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -475,7 +475,8 @@ static void be_blur(unsigned char *buf, int w, int h) int glyph_to_bitmap(ASS_Library *library, ASS_SynthPriv *priv_blur, FT_Glyph glyph, FT_Glyph outline_glyph, Bitmap **bm_g, Bitmap **bm_o, Bitmap **bm_s, - int be, double blur_radius, FT_Vector shadow_offset) + int be, double blur_radius, FT_Vector shadow_offset, + int border_style) { blur_radius *= 2; int bbord = be > 0 ? sqrt(2 * be) : 0; @@ -527,7 +528,9 @@ int glyph_to_bitmap(ASS_Library *library, ASS_SynthPriv *priv_blur, priv_blur->g_w); } - if (*bm_o) + if (*bm_o && border_style == 3) + *bm_s = copy_bitmap(*bm_o); + else if (*bm_o) *bm_s = fix_outline_and_shadow(*bm_g, *bm_o); else *bm_s = copy_bitmap(*bm_g); diff --git a/libass/ass_bitmap.h b/libass/ass_bitmap.h index 3b63cee..338db01 100644 --- a/libass/ass_bitmap.h +++ b/libass/ass_bitmap.h @@ -49,7 +49,8 @@ typedef struct { int glyph_to_bitmap(ASS_Library *library, ASS_SynthPriv *priv_blur, FT_Glyph glyph, FT_Glyph outline_glyph, Bitmap **bm_g, Bitmap **bm_o, Bitmap **bm_s, - int be, double blur_radius, FT_Vector shadow_offset); + int be, double blur_radius, FT_Vector shadow_offset, + int border_style); void ass_free_bitmap(Bitmap *bm); diff --git a/libass/ass_render.c b/libass/ass_render.c index f67cba6..514dfbe 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -2161,7 +2161,8 @@ get_bitmap_glyph(ASS_Renderer *render_priv, GlyphInfo *info) &info->bm, &info->bm_o, &info->bm_s, info->be, info->blur * render_priv->border_scale, - info->hash_key.shadow_offset); + info->hash_key.shadow_offset, + info->hash_key.border_style); if (error) info->symbol = 0;