summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2011-07-10 01:53:09 +0200
committerGrigori Goronzy <greg@blackbox>2011-07-10 01:53:09 +0200
commit131b23f717d0d775d4730d1d8ffd5195344f71a8 (patch)
tree4c9bfa5dcda2ffac9d06728fe4fa62b36f24f228
parent1500ce05a00a5d4a73728137cdf2d0a1ffa278d1 (diff)
downloadlibass-131b23f717d0d775d4730d1d8ffd5195344f71a8.tar.bz2
libass-131b23f717d0d775d4730d1d8ffd5195344f71a8.tar.xz
Fix bitmap cache
Pass the *complete* hash key to the cache handling functions, not only the outline-specific subkey. This mistake completely stopped the cache from actually working and resulted in great slowdown!
-rw-r--r--libass/ass_render.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index c0f7c87..b418bb1 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1250,7 +1250,7 @@ get_bitmap_glyph(ASS_Renderer *render_priv, GlyphInfo *info)
BitmapHashValue *val;
OutlineBitmapHashKey *key = &info->hash_key.u.outline;
- val = ass_cache_get(render_priv->cache.bitmap_cache, key);
+ val = ass_cache_get(render_priv->cache.bitmap_cache, &info->hash_key);
if (val) {
info->bm = val->bm;
@@ -1312,7 +1312,8 @@ get_bitmap_glyph(ASS_Renderer *render_priv, GlyphInfo *info)
hash_val.bm_o = info->bm_o;
hash_val.bm = info->bm;
hash_val.bm_s = info->bm_s;
- ass_cache_put(render_priv->cache.bitmap_cache, key, &hash_val);
+ ass_cache_put(render_priv->cache.bitmap_cache, &info->hash_key,
+ &hash_val);
outline_free(render_priv->ftlibrary, outline);
outline_free(render_priv->ftlibrary, border);