From 7514642f2575fd58c4f4809d74a0099f22d256f0 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Wed, 29 Jan 2014 20:54:45 +0000 Subject: Fix subpixel jumping of rotated glyph runs Rotation origin was not taken into account when caching glyph run bitmaps. --- libass/ass_cache_template.h | 2 ++ libass/ass_render.c | 6 +++++- libass/ass_render.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libass/ass_cache_template.h b/libass/ass_cache_template.h index 8f7f2af..c91c897 100644 --- a/libass/ass_cache_template.h +++ b/libass/ass_cache_template.h @@ -149,6 +149,8 @@ START(composite, composite_hash_key) GENERIC(unsigned, bold) GENERIC(int, flags) GENERIC(unsigned, has_outline) + GENERIC(int, shift_x) + GENERIC(int, shift_y) FTVECTOR(advance) STRING(str) END(CompositeHashKey) diff --git a/libass/ass_render.c b/libass/ass_render.c index d299f1b..e629fdd 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1020,6 +1020,8 @@ static void fill_composite_hash(CompositeHashKey *hk, CombinedBitmapInfo *info) hk->frz = info->frz; hk->fax = info->fax; hk->fay = info->fay; + hk->shift_x = info->shift_x; + hk->shift_y = info->shift_y; hk->advance = info->advance; } @@ -2334,7 +2336,9 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, current_info->bold = info->bold; current_info->flags = info->flags; - current_info->advance = info->hash_key.u.outline.advance; + current_info->shift_x = key->shift_x; + current_info->shift_y = key->shift_y; + current_info->advance = key->advance; current_info->has_border = !!info->border; diff --git a/libass/ass_render.h b/libass/ass_render.h index 6552aeb..7b3b6d7 100644 --- a/libass/ass_render.h +++ b/libass/ass_render.h @@ -135,6 +135,7 @@ typedef struct { unsigned italic; unsigned bold; int flags; + int shift_x, shift_y; unsigned has_outline; unsigned is_drawing; -- cgit v1.2.3