RE: Pango draw text is 600 times slow !!??



Setting up pango and freeing will take a lot of time.
But I really don't know how to setup pango one and use it.
        The first function:
        gtk_widget_create_pango_layout
        need the string as parameter.


-----Original Message-----
From: gtk-app-devel-list-admin gnome org
[mailto:gtk-app-devel-list-admin gnome org] On Behalf Of Behdad Esfahbod
Sent: Friday, December 19, 2003 7:22 PM
To: Tom Liu
Cc: gtk-app-devel-list gnome org
Subject: Re: Pango draw text is 600 times slow !!??


I say it this way:  Setting up pango, drawing, and freeing
everything, is 600 times slower than drawing using X call.  But
perhaps it is not what people are interested in.  What people are
interested in is how many times pango drawing is slower than X
call.  Setting up pango and freeing memory is done once and
should not be counted there.


behdad

On Fri, 19 Dec 2003, Tom Liu wrote:

Please see this code: it is 600 times slower to use pango.

I think it must be my program's problem. But how to use pango
correctly?

The code to use pango draw string I just copied for GTK FAQ.



Thanks





//to use pango:

    for(k=0;k<1;k++) {

    for (i=0;i<100;i++){

            for (j=0;j<100;j++) {

                    PangoLayout *layout =
gtk_widget_create_pango_layout
(widget, "abcd");

                    PangoFontDescription *fontdesc =
pango_font_description_from_string ("Luxi Mono 12");

                    pango_layout_set_font_description (layout,
fontdesc);

                    gdk_draw_layout (w->window,m_gc,i,j,layout);

                    pango_font_description_free (fontdesc);

                    g_object_unref (layout);

                    seq++;

            }

            seq++;

    }



// to use the xcall.

    for(k=0;k<1;k++) {

    for (i=0;i<100;i++){

            for (j=0;j<100;j++) {

                    XDrawString(GDK_DISPLAY(),
GDK_WINDOW_XID(w->window), GDK_GC_XGC(m_gc),

                                     i , j, "abcd", 4);

                    seq++;

            }

            seq++;

    }


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]