summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2017-09-05 21:15:40 -0500
committerRodger Combs <rodger.combs@gmail.com>2017-10-22 06:38:51 -0500
commit68f25e2c26de2c5c3624bf0fe6d12a0e9c35e861 (patch)
tree976bab143307d46582206e41d8e147729f5a16d0 /libass
parent9b874841274ef0262872c53f9b9eb5d2bc054c8f (diff)
downloadlibass-68f25e2c26de2c5c3624bf0fe6d12a0e9c35e861.tar.bz2
libass-68f25e2c26de2c5c3624bf0fe6d12a0e9c35e861.tar.xz
ass_set_fonts: empty cache as well
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render_api.c4
-rw-r--r--libass/ass_shaper.c7
-rw-r--r--libass/ass_shaper.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/libass/ass_render_api.c b/libass/ass_render_api.c
index 2e61b7e..4930c44 100644
--- a/libass/ass_render_api.c
+++ b/libass/ass_render_api.c
@@ -146,6 +146,10 @@ void ass_set_fonts(ASS_Renderer *priv, const char *default_font,
ass_reconfigure(priv);
+ ass_cache_empty(priv->cache.font_cache);
+ if (priv->shaper)
+ ass_shaper_empty_cache(priv->shaper);
+
if (priv->fontselect)
ass_fontselect_free(priv->fontselect);
priv->fontselect = ass_fontselect_init(priv->library, priv->ftlibrary,
diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c
index 5f24c5a..657885b 100644
--- a/libass/ass_shaper.c
+++ b/libass/ass_shaper.c
@@ -121,6 +121,13 @@ void ass_shaper_free(ASS_Shaper *shaper)
free(shaper);
}
+void ass_shaper_empty_cache(ASS_Shaper *shaper)
+{
+#ifdef CONFIG_HARFBUZZ
+ ass_cache_empty(shaper->metrics_cache);
+#endif
+}
+
void ass_shaper_font_data_free(ASS_ShaperFontData *priv)
{
#ifdef CONFIG_HARFBUZZ
diff --git a/libass/ass_shaper.h b/libass/ass_shaper.h
index 0d1dfc2..f6404fe 100644
--- a/libass/ass_shaper.h
+++ b/libass/ass_shaper.h
@@ -27,6 +27,7 @@ typedef struct ass_shaper ASS_Shaper;
void ass_shaper_info(ASS_Library *lib);
ASS_Shaper *ass_shaper_new(size_t prealloc);
void ass_shaper_free(ASS_Shaper *shaper);
+void ass_shaper_empty_cache(ASS_Shaper *shaper);
void ass_shaper_set_kerning(ASS_Shaper *shaper, int kern);
void ass_shaper_find_runs(ASS_Shaper *shaper, ASS_Renderer *render_priv,
GlyphInfo *glyphs, size_t len);