summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2014-01-29 20:54:45 +0000
committerOleg Oshmyan <chortos@inbox.lv>2014-01-29 21:27:17 +0000
commit7514642f2575fd58c4f4809d74a0099f22d256f0 (patch)
treea2dfcf6e3f70a48c07e7f443f14a773e70d0eb54
parent678a46dfc18ccadedf79a6da8104a84d2bd9dbf7 (diff)
downloadlibass-7514642f2575fd58c4f4809d74a0099f22d256f0.tar.bz2
libass-7514642f2575fd58c4f4809d74a0099f22d256f0.tar.xz
Fix subpixel jumping of rotated glyph runs
Rotation origin was not taken into account when caching glyph run bitmaps.
-rw-r--r--libass/ass_cache_template.h2
-rw-r--r--libass/ass_render.c6
-rw-r--r--libass/ass_render.h1
3 files changed, 8 insertions, 1 deletions
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;