From 131b23f717d0d775d4730d1d8ffd5195344f71a8 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sun, 10 Jul 2011 01:53:09 +0200 Subject: 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! --- libass/ass_render.c | 5 +++-- 1 file 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); -- cgit v1.2.3