Re: [gtk-list] gdk_draw_* and friends



I'd like to second this motion and perhaps get the discussion started
again...   This last weekend I converted a program that I've been working on
from X11 to Gtk+ (I must say as an aside, it was a very enjoyable experience).

My program used XDrawArcs to draw new arcs and undraw old arcs  at the same
time using a Invert GC.  This is much faster and consumes far less memory than
maintaining a 1600x1200 pixmap as a double buffer.   When there was no
gdk_draw_arcs I didn't think twice, I just went ahead and added it my
installation of 1.2.7.

Scrolling through the list archives, I've seen a little debate on whether it
was a good idea or not, including one benchmark program that I believe was
flawed - it tested the speed of 1000 LARGE, FILLED, primitives instead of many
smaller primitives.   Granted, even after I edited the program to try to
illustrate the difference, the shared memory X server still showed hardly any
difference.   It was not until I tried running on a computer several hops away
that I noticed a good 2:1 improvement with draw_arcs over draw_arc.

I'm just worried that potentially, we're missing some good that the multiple
draws could come to.   Deborah Swayne writes about the window side, but
potentially could there be better optimized Xservers that exhibit the same
amazing benefit?   Um, don't ask me.

-joel



Deborah Swayne wrote:

> I've been interested all discussion about plural gdk_draw
> routines, since I'm used to using those in X, and I do a <lot> of
> drawing -- scatterplots of up to 100,000 points, which may be in
> motion.  I was delighted to be convinced that they don't improve
> performance, because it simplifies my code to get rid of them.
>
> However, I've just learned that the plural routines improve
> performance **twenty-fold** for Windows versions of gtk
> programs.  I can take advantage of this information to improve
> the drawing speed for points and line segments, but I'm in
> trouble when it comes to polygons and arcs.  (I do my work on
> *nix, but I do want the results to run under Windows.)
>
> Given what I'm learning about the Windows API, the most useful
> routine would be gdk_draw_polygons.  Windows draws rectangles as
> polygons anyway, and they have no plural routine for drawing
> arcs.  (They use a routine called PolyPolygon for drawing
> multiple polygons.)
>
> I don't know whether the gtk authors take Windows portability
> issues into consideration when making gtk/gdk design choices.
> That can lead to weird deformations in gtk design, but it can
> also make gtk much more powerful as a toolkit for writing
> portable code.  For me, it is a significant competitor to Java
> even now.
>
> Debby
>
> --
> Deborah Swayne               AT&T Labs - Research
> dfs@research.att.com         Shannon Laboratory, Room B295
> www.research.att.com/~dfs    180 Park Avenue
> 973 360-8423                 Florham Park, NJ 07932-0971
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



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