diff --git a/clutter/clutter/clutter-context.c b/clutter/clutter/clutter-context.c index 90f68ba1c..9a85b9aaf 100644 --- a/clutter/clutter/clutter-context.c +++ b/clutter/clutter/clutter-context.c @@ -301,11 +301,15 @@ clutter_context_get_pango_fontmap (ClutterContext *context) CoglPangoFontMap *font_map; gdouble resolution; gboolean use_mipmapping; + ClutterBackend *backend; + CoglContext *cogl_context; if (G_LIKELY (context->font_map != NULL)) return context->font_map; - font_map = COGL_PANGO_FONT_MAP (cogl_pango_font_map_new ()); + backend = clutter_context_get_backend (context); + cogl_context = clutter_backend_get_cogl_context (backend); + font_map = COGL_PANGO_FONT_MAP (cogl_pango_font_map_new (cogl_context)); resolution = clutter_backend_get_resolution (context->backend); cogl_pango_font_map_set_resolution (font_map, resolution); diff --git a/cogl/cogl-pango/cogl-pango-fontmap.c b/cogl/cogl-pango/cogl-pango-fontmap.c index a35635855..4d089c242 100644 --- a/cogl/cogl-pango/cogl-pango-fontmap.c +++ b/cogl/cogl-pango/cogl-pango-fontmap.c @@ -57,13 +57,11 @@ free_priv (gpointer data) } PangoFontMap * -cogl_pango_font_map_new (void) +cogl_pango_font_map_new (CoglContext *context) { PangoFontMap *fm = pango_cairo_font_map_new (); g_autofree CoglPangoFontMapPriv *priv = g_new0 (CoglPangoFontMapPriv, 1); - _COGL_GET_CONTEXT (context, NULL); - priv->ctx = g_object_ref (context); /* XXX: The public pango api doesn't let us sub-class diff --git a/cogl/cogl-pango/cogl-pango.h b/cogl/cogl-pango/cogl-pango.h index 99b970db1..cf16ebd56 100644 --- a/cogl/cogl-pango/cogl-pango.h +++ b/cogl/cogl-pango/cogl-pango.h @@ -73,7 +73,7 @@ typedef PangoCairoFontMap CoglPangoFontMap; * Return value: (transfer full): the newly created #PangoFontMap */ COGL_EXPORT PangoFontMap * -cogl_pango_font_map_new (void); +cogl_pango_font_map_new (CoglContext *context); /** * cogl_pango_font_map_create_context: @@ -92,9 +92,9 @@ cogl_pango_font_map_create_context (CoglPangoFontMap *font_map); * @dpi: The resolution in "dots per inch". (Physical inches aren't * actually involved; the terminology is conventional.) * - * Sets the resolution for the @font_map. - * - * This is a scale factor between points specified in a + * Sets the resolution for the @font_map. + * + * This is a scale factor between points specified in a * [struct@Pango.FontDescription] and Cogl units. * The default value is %96, meaning that a 10 point font will be 13 * units high. (10 * 96. / 72. = 13.3).