From ce16b9e1a19c3983a20f9a09d30ab7843cccdc14 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 22 Aug 2011 00:21:50 +0200 Subject: opaque box: avoid unnecessary outline copy It's faster and easier to just create a new outline, than to copy it, free it, and create a new one. The old glyph-based code needed to do this since it's not possible to create a glyph "from scratch". --- libass/ass_render.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 7a7e397..d317d98 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -986,7 +986,6 @@ static void draw_opaque_box(ASS_Renderer *render_priv, int asc, int desc, { .x = -sx, .y = -desc - sy }, }; - FT_Outline_Done(render_priv->ftlibrary, ol); FT_Outline_New(render_priv->ftlibrary, 4, 1, ol); ol->n_points = ol->n_contours = 0; @@ -1158,7 +1157,7 @@ get_outline_glyph(ASS_Renderer *priv, GlyphInfo *info) (info->border_x > 0 || info->border_y > 0)) { FT_Vector advance; - outline_copy(priv->ftlibrary, v.outline, &v.border); + v.border = calloc(1, sizeof(FT_Outline)); if (priv->settings.shaper == ASS_SHAPING_SIMPLE || info->drawing) advance = v.advance; -- cgit v1.2.3