summaryrefslogtreecommitdiffstats
path: root/libass/ass_bitmap.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-07-10 19:31:07 +0200
committerGrigori Goronzy <greg@blackbox>2009-07-10 19:31:07 +0200
commitba770fa05426c04d5a1900b37fc7bcc700584720 (patch)
treea7476f0c2f619e0c89e6011e4464618a6ca8944b /libass/ass_bitmap.c
parent15df379c97159dbbc8d876a769edac0f8efecd75 (diff)
downloadlibass-ba770fa05426c04d5a1900b37fc7bcc700584720.tar.bz2
libass-ba770fa05426c04d5a1900b37fc7bcc700584720.tar.xz
Slight optimizations for \be, \blur
Enlarge bitmap glyphs less for \be, this is especially effective for lots of \be applications. Also make sure that the gaussian blur buffers are only updated if gaussian blur is actually used for a particular glyph.
Diffstat (limited to 'libass/ass_bitmap.c')
-rw-r--r--libass/ass_bitmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c
index 16d2b35..d28d47b 100644
--- a/libass/ass_bitmap.c
+++ b/libass/ass_bitmap.c
@@ -355,7 +355,7 @@ int glyph_to_bitmap(ass_synth_priv_t *priv_blur,
bitmap_t **bm_g, bitmap_t **bm_o, bitmap_t **bm_s,
int be, double blur_radius, FT_Vector shadow_offset)
{
- int bord = be ? (be / 4 + 1) : 0;
+ int bord = be ? (be / 8 + 1) : 0;
blur_radius *= 2;
bord = (blur_radius > 0.0) ? blur_radius + 1 : bord;
if (bord == 0 && (shadow_offset.x || shadow_offset.y))
@@ -377,9 +377,6 @@ int glyph_to_bitmap(ass_synth_priv_t *priv_blur,
return 1;
}
}
- if (*bm_o)
- resize_tmp(priv_blur, (*bm_o)->w, (*bm_o)->h);
- resize_tmp(priv_blur, (*bm_g)->w, (*bm_g)->h);
if (be) {
while (be--) {
@@ -390,6 +387,9 @@ int glyph_to_bitmap(ass_synth_priv_t *priv_blur,
}
} else {
if (blur_radius > 0.0) {
+ if (*bm_o)
+ resize_tmp(priv_blur, (*bm_o)->w, (*bm_o)->h);
+ resize_tmp(priv_blur, (*bm_g)->w, (*bm_g)->h);
generate_tables(priv_blur, blur_radius);
if (*bm_o)
ass_gauss_blur((*bm_o)->buffer, priv_blur->tmp,