]> granicus.if.org Git - libass/commitdiff
Fix bitmap cache
authorGrigori Goronzy <greg@blackbox>
Sat, 9 Jul 2011 23:53:09 +0000 (01:53 +0200)
committerGrigori Goronzy <greg@blackbox>
Sat, 9 Jul 2011 23:53:09 +0000 (01:53 +0200)
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

index c0f7c87498f05a40a2711a309ce8de2d0f66a2b3..b418bb18264c9a615e12b3ce96cab6ba97aff992 100644 (file)
@@ -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);