summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2017-01-30 23:45:43 +0200
committerOleg Oshmyan <chortos@inbox.lv>2017-01-31 02:13:30 +0200
commitd4bd51a0b1e7192773af328213b51b19931602db (patch)
treeb6e005fb5ee38e32b46ea9b7725212dedb9c5f7c /libass
parentc7fbe80b29d0e64c36ca0872b8ddc1f766f89f5a (diff)
downloadlibass-d4bd51a0b1e7192773af328213b51b19931602db.tar.bz2
libass-d4bd51a0b1e7192773af328213b51b19931602db.tar.xz
Reflect border_scale in outline cache keys
border_scale can change, e. g. when ass_render_frame is called twice with the same renderer but different tracks. Glyphs with equal \bord tag values but different border_scale values produce different border outlines and hence should be distinguished in outline cache keys. To this end, store scaled border widths (which are really used when generating the outlines) in cache keys instead of \bord tag values.
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 4e97d2a..558f504 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1084,8 +1084,8 @@ fill_glyph_hash(ASS_Renderer *priv, OutlineHashKey *outline_key,
outline_key->type = OUTLINE_DRAWING;
key->scale_x = double_to_d16(info->scale_x);
key->scale_y = double_to_d16(info->scale_y);
- key->outline.x = double_to_d16(info->border_x);
- key->outline.y = double_to_d16(info->border_y);
+ key->outline.x = double_to_d16(info->border_x * priv->border_scale);
+ key->outline.y = double_to_d16(info->border_y * priv->border_scale);
key->border_style = info->border_style;
// hpacing only matters for opaque box borders (see draw_opaque_box),
// so for normal borders, maximize cache utility by ignoring it
@@ -1106,8 +1106,8 @@ fill_glyph_hash(ASS_Renderer *priv, OutlineHashKey *outline_key,
key->italic = info->italic;
key->scale_x = double_to_d16(info->scale_x);
key->scale_y = double_to_d16(info->scale_y);
- key->outline.x = double_to_d16(info->border_x);
- key->outline.y = double_to_d16(info->border_y);
+ key->outline.x = double_to_d16(info->border_x * priv->border_scale);
+ key->outline.y = double_to_d16(info->border_y * priv->border_scale);
key->flags = info->flags;
key->border_style = info->border_style;
key->hspacing =