From ae4a6d27fbd3b8c5fec3d459b118ce820ee9042f Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Sun, 18 Oct 2020 02:42:18 +0300 Subject: shaper: honor/reuse starts_new_run This removes duplicated code (and a not-fully-correct comment). This also ensures shaping has breaks whenever the rest of the pipeline breaks runs (e. g. for bitmap combining). In particular, this adds missing breaks on karaoke changes, which the old code didn't actually honor despite the comment. --- libass/ass_shaper.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c index d9fd590..273bfb1 100644 --- a/libass/ass_shaper.c +++ b/libass/ass_shaper.c @@ -786,36 +786,10 @@ void ass_shaper_find_runs(ASS_Shaper *shaper, ASS_Renderer *render_priv, // set size and get glyph index ass_font_get_index(render_priv->fontselect, info->font, info->symbol, &info->face_index, &info->glyph_index); - // shape runs break on: xbord, ybord, xshad, yshad, - // all four colors, all four alphas, be, blur, fn, fs, - // fscx, fscy, fsp, bold, italic, underline, strikeout, - // frx, fry, frz, fax, fay, karaoke start, karaoke type, - // and on every line break if (i > 0 && (last->font != info->font || last->face_index != info->face_index || last->script != info->script || - last->font_size != info->font_size || - last->c[0] != info->c[0] || - last->c[1] != info->c[1] || - last->c[2] != info->c[2] || - last->c[3] != info->c[3] || - last->be != info->be || - last->blur != info->blur || - last->shadow_x != info->shadow_x || - last->shadow_y != info->shadow_y || - last->frx != info->frx || - last->fry != info->fry || - last->frz != info->frz || - last->fax != info->fax || - last->fay != info->fay || - last->scale_x != info->scale_x || - last->scale_y != info->scale_y || - last->border_style != info->border_style || - last->border_x != info->border_x || - last->border_y != info->border_y || - last->hspacing != info->hspacing || - last->italic != info->italic || - last->bold != info->bold || + info->starts_new_run || last->flags != info->flags)) shape_run++; info->shape_run_id = shape_run; -- cgit v1.2.3