From: Sean E. <sea...@us...> - 2002-10-09 05:47:41
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv17575/src Modified Files: gtkimhtml.c Log Message: Somewhat faster Pangonated gtkimhtml by Christian Hammond Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- gtkimhtml.c 8 Oct 2002 23:45:20 -0000 1.121 +++ gtkimhtml.c 9 Oct 2002 05:47:38 -0000 1.122 @@ -449,15 +449,17 @@ text_width(PangoContext *context, PangoFontDescription *desc, const char *text, gint len) { - PangoLayout *layout; + static PangoLayout *layout = NULL; int width; - layout = pango_layout_new(context); + if (layout == NULL) + layout = pango_layout_new(context); + pango_layout_set_font_description(layout, desc); pango_layout_set_text(layout, text, len); pango_layout_get_pixel_size(layout, &width, NULL); - g_object_unref(G_OBJECT(layout)); + /* g_object_unref(G_OBJECT(layout)); */ return width; } |