diff libass/ass_cache.c @ 31853:e64df5862cea

Import libass 0.9.10
author greg
date Fri, 06 Aug 2010 21:13:41 +0000
parents 48d020c5ceca
children 88eebbbbd6a0
line wrap: on
line diff
--- a/libass/ass_cache.c	Fri Aug 06 10:48:16 2010 +0000
+++ b/libass/ass_cache.c	Fri Aug 06 21:13:41 2010 +0000
@@ -156,6 +156,8 @@
         return 0;
     if (a->treat_family_as_pattern != b->treat_family_as_pattern)
         return 0;
+    if (a->vertical != b->vertical)
+        return 0;
     return 1;
 }
 
@@ -286,6 +288,11 @@
 void *cache_add_glyph(Hashmap *glyph_cache, GlyphHashKey *key,
                       GlyphHashValue *val)
 {
+	if (val->glyph && val->glyph->format == FT_GLYPH_FORMAT_BITMAP) {
+		FT_Bitmap *bitmap = &((FT_BitmapGlyph) val->glyph)->bitmap;
+		glyph_cache->cache_size += bitmap->rows * bitmap->pitch;
+	}
+
     return hashmap_insert(glyph_cache, key, val);
 }