Pango draw text is 600 times slow !!??



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]