summaryrefslogtreecommitdiff
path: root/pango/pangocairo-fontmap.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2005-11-04 20:53:03 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2005-11-04 20:53:03 +0000
commit69bbb89d5436cae4602579f952d68e84efe9ec24 (patch)
treecafa20b6afa089fb6b8f834fbdccfdac30371cb4 /pango/pangocairo-fontmap.c
parentf3d4ab2fecbc21745436e54b81729a330a915648 (diff)
downloadpango-69bbb89d5436cae4602579f952d68e84efe9ec24.tar.gz
Use quarks for GObject data to improve performance. (Patch from Federico
2005-11-04 Behdad Esfahbod <behdad@gnome.org> * pango/pangocairo-fontmap.c: Use quarks for GObject data to improve performance. (Patch from Federico Mena Quintero) * pango/modules.c (pango_module_load), pango/querymodules.c: Pass G_MODULE_BIND_LAZY to g_module_open. (Pointed by John Rice)
Diffstat (limited to 'pango/pangocairo-fontmap.c')
-rw-r--r--pango/pangocairo-fontmap.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/pango/pangocairo-fontmap.c b/pango/pangocairo-fontmap.c
index 9fd7d87a..8dd82877 100644
--- a/pango/pangocairo-fontmap.c
+++ b/pango/pangocairo-fontmap.c
@@ -220,8 +220,14 @@ static PangoCairoContextInfo *
get_context_info (PangoContext *context,
gboolean create)
{
- PangoCairoContextInfo *info = g_object_get_data (G_OBJECT (context),
- "pango-cairo-context-info");
+ static GQuark context_info_quark;
+ PangoCairoContextInfo *info;
+
+ if (!context_info_quark)
+ context_info_quark = g_quark_from_static_string ("pango-cairo-context-info");
+
+ info = g_object_get_qdata (G_OBJECT (context), context_info_quark);
+
if (!info && create)
{
info = g_new (PangoCairoContextInfo, 1);
@@ -230,8 +236,8 @@ get_context_info (PangoContext *context,
info->surface_options = NULL;
info->merged_options = NULL;
- g_object_set_data_full (G_OBJECT (context), "pango-cairo-context-info",
- info, (GDestroyNotify)free_context_info);
+ g_object_set_qdata_full (G_OBJECT (context), context_info_quark,
+ info, (GDestroyNotify)free_context_info);
}
return info;