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++;

    }





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