From 82b225b3d6653091d028b39d561d185ed76a7be5 Mon Sep 17 00:00:00 2001 From: "Dr.Smile" Date: Sun, 13 Dec 2020 17:23:26 +0300 Subject: parsing: use string references for font family and drawing text That eliminates most uses of strdup() in the rendering process. --- libass/ass_shaper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libass/ass_shaper.c') diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c index 41392c6..4665e7a 100644 --- a/libass/ass_shaper.c +++ b/libass/ass_shaper.c @@ -665,7 +665,7 @@ static bool shape_harfbuzz(ASS_Shaper *shaper, GlyphInfo *glyphs, size_t len) glyphs[i].skip = true; for (i = 0; i < len; i++) { - if (glyphs[i].drawing_text) { + if (glyphs[i].drawing_text.str) { glyphs[i].skip = false; continue; } @@ -805,7 +805,7 @@ void ass_shaper_find_runs(ASS_Shaper *shaper, ASS_Renderer *render_priv, // find appropriate fonts for the shape runs for (i = 0; i < len; i++) { GlyphInfo *info = glyphs + i; - if (!info->drawing_text) { + if (!info->drawing_text.str) { // set size and get glyph index ass_font_get_index(render_priv->fontselect, info->font, info->symbol, &info->face_index, &info->glyph_index); -- cgit v1.2.3