ctx = CLUTTER_CONTEXT ();
priv->pango_context = _clutter_context_create_pango_context (ctx);
+ g_object_ref (priv->pango_context);
return priv->pango_context;
}
gdouble resolution;
cairo_font_options_t *font_options;
+ if (G_LIKELY (self->pango_context != NULL))
+ context = self->pango_context;
+ else
+ {
+ context = cogl_pango_font_map_create_context (self->font_map);
+ self->pango_context = context;
+ }
+
+ font_options = clutter_backend_get_font_options (self->backend);
resolution = clutter_backend_get_resolution (self->backend);
if (resolution < 0)
resolution = 96.0; /* fall back */
- context = cogl_pango_font_map_create_context (self->font_map);
-
- pango_cairo_context_set_resolution (context, resolution);
-
- font_options = clutter_backend_get_font_options (self->backend);
pango_cairo_context_set_font_options (context, font_options);
+ pango_cairo_context_set_resolution (context, resolution);
return context;
}
gint fb_r_mask, fb_g_mask, fb_b_mask;
gint fb_r_mask_used, fb_g_mask_used, fb_b_mask_used;
- CoglPangoFontMap *font_map; /* Global font map */
+ PangoContext *pango_context; /* Global Pango context */
+ CoglPangoFontMap *font_map; /* Global font map */
- GSList *input_devices; /* For extra input devices, i.e
- MultiTouch */
+ GSList *input_devices; /* For extra input devices, i.e
+ MultiTouch */
};
#define CLUTTER_CONTEXT() (clutter_context_get_default ())