Re: Copying X pixmap.
- From: Owen Taylor <otaylor redhat com>
- To: Fritz Ganter <ganter ganter at>
- Cc: gtk-list gnome org
- Subject: Re: Copying X pixmap.
- Date: 04 May 2003 10:33:35 -0400
On Sun, 2003-05-04 at 08:33, Fritz Ganter wrote:
> Am Son, 2003-05-04 um 03.32 schrieb Owen Taylor:
>
> > a) disable double buffering for that widget with
>
> I'm porting gpsdrive (http://www.kraftvoll.at/software/index.shtml) from
> gtk-1.2 to gtk 2.2.
> But the performance is terrible, with gtk-1.2 I have around 4% CPU
> usage, with gtk-2.2 its about 30-40%
> I'm drawing ~ 600x500 big pixmaps 3 times a second to the screen. In
> gtk-1.2 I did doublebuffering myself (drawing all on a pixmap, then
> drawing it to the main window gdk_draw_pixmap
> (drawing_area->window,..).
> I did now
> drawable = gdk_pixmap_new (mainwindow->window, SCREEN_X, SCREEN_Y,
> -1);
>
> this added -> gtk_widget_set_double_buffered(drawable, FALSE);
>
> But this doesn't give me the performance back.
> Another question: does a gtk_label_set_markup (GTK_LABEL (altilabel),
> s3); have a bad perforcmance? I draw about 20 characters 3 times a
> second. This replaces my old gdk-style manipulation to draw in a bigger
> font.
Well, there is certainly overhead from parsing the markup; but for
3 times a second, it doesn't matter.
Notes:
- Drawing speed should not be significantly different with GTK+-1.2
and GTK+-2.0 for lines/etc.
- Pango is much slower than the old X bitmap fonts (the necessary
cost of doing a lot more); but that "much slower" is on the order
0.5 million characters/second. Which doesn't sound like it should
be an issue for your app.
I think you need to profile and see where your time is going;
valgrind/kcachegrind is a very good combination for profiling.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]