[text] Use create_pango_layout()
authorEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 2 Feb 2009 12:04:34 +0000 (12:04 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 2 Feb 2009 12:07:29 +0000 (12:07 +0000)
Since we added clutter_actor_get_pango_layout() it would be a
good idea to use it in the ClutterText actor to cut down the
PangoContext-related calls.

clutter/clutter-text.c

index 4ba84e0..37784ed 100644 (file)
@@ -234,12 +234,9 @@ clutter_text_create_layout_no_cache (ClutterText *text,
                                      ClutterUnit  allocation_width)
 {
   ClutterTextPrivate *priv = text->priv;
-  PangoContext *context;
   PangoLayout *layout;
 
-  context = clutter_actor_get_pango_context (CLUTTER_ACTOR (text));
-  layout = pango_layout_new (context);
-
+  layout = clutter_actor_create_pango_layout (CLUTTER_ACTOR (text), NULL);
   pango_layout_set_font_description (layout, priv->font_desc);
 
   if (priv->text)