summaryrefslogtreecommitdiff
path: root/pango/pangoxft-fontmap.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-08-06 04:13:08 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-08-06 04:13:08 +0000
commit676c0367f14e1ae58ae04397d39640e06b502d57 (patch)
tree54709df53239fd685bd08245f720e65515103263 /pango/pangoxft-fontmap.c
parent9629e9e1ffa2f76989c877a2c2e4c0324716100d (diff)
downloadpango-676c0367f14e1ae58ae04397d39640e06b502d57.tar.gz
Use FcPatternHash instead of rolling our own. (Slight speed decrease)
Mon Aug 5 23:57:59 2002 Owen Taylor <otaylor@redhat.com> * pango/pangoxft-fontmap.c (pango_xft_pattern_hash): Use FcPatternHash instead of rolling our own. (Slight speed decrease) (Keith Packard) * pango/pangoxft-fontmap.c (pango_xft_get_font_map): Remove accidentally deleted call to init_fontset_hash().
Diffstat (limited to 'pango/pangoxft-fontmap.c')
-rw-r--r--pango/pangoxft-fontmap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pango/pangoxft-fontmap.c b/pango/pangoxft-fontmap.c
index 32926f0a..5e9ccab9 100644
--- a/pango/pangoxft-fontmap.c
+++ b/pango/pangoxft-fontmap.c
@@ -178,11 +178,16 @@ static GSList *fontmaps = NULL;
guint
pango_xft_pattern_hash (FcPattern *pattern)
{
+#if 1
+ return FcPatternHash (pattern);
+#else
+ /* Hashing only part of the pattern can improve speed a bit.
+ */
char *str;
int i;
double d;
guint hash = 0;
-
+
FcPatternGetString (pattern, FC_FILE, 0, (FcChar8 **) &str);
if (str)
hash = g_str_hash (str);
@@ -194,6 +199,7 @@ pango_xft_pattern_hash (FcPattern *pattern)
hash ^= (guint) (d*1000.0);
return hash;
+#endif
}
gboolean
@@ -297,6 +303,7 @@ pango_xft_get_font_map (Display *display,
xfontmap->fonts = g_hash_table_new ((GHashFunc)pango_xft_pattern_hash,
(GEqualFunc)pango_xft_pattern_equal);
+ pango_xft_init_fontset_hash (xfontmap);
xfontmap->coverage_hash = g_hash_table_new_full ((GHashFunc)pango_xft_coverage_key_hash,
(GEqualFunc)pango_xft_coverage_key_equal,
(GDestroyNotify)g_free,