Re: gdk_draw_* and friends

Dan Kressin <> writes:

> Antonio Campos wrote:
> > 
> > Digging randomly through the gdk.h include file, I stopped at
> > gdk_draw_* functions. I noticed the functions:
> [snip]
> > and of course:
> > gdk_draw_rectangle             (*)
> > gdk_draw_arc                        (*)
> > 
> > Then, I realized than X has more drawing functions...
> > I issued an "apropos", and XDrawRectangles, XDrawArcs appeared.
> > 
> > Then I thought why shouldn't gdk wrap these two X drawing functions as
> > well.
> > If I'm correct, these two functions are used to send the X Server a
> > bunch of rectangles or arcs, which is a very useful thing because the X
> > Server may communicate with the clients through a network.
> > 
> > So, wouldn't be nice to add two more functions to gdk?
> They do, in fact, save on network traffic over multiple *Arc or
> *Rectangle calls.  

Yes for Arc, no for Rectangle. (Look at the implementation
of XDrawRectangle if you don't believe me. Xlib is smart
enough to batch up multiple consecutive DrawRectangle

> I actually wrote and submitted the code to implement
> the plural versions of those functions back in the early days of the 1.1
> series, but I guess it never got accepted by the powers that be.  Not
> entirely sure why.
> Owen?  I think you were the one that told me how to submit the code via
> ftp, any idea why it was never included?

I believe at the same time, I asked for benchmarks proving that
there is a significant gain (E.g., "I can draw 50,000 arcs a second
using XDrawArcs, but only 20,000 a second using XDrawArc".)
Maybe you did send such benchmarks and I just missed them...

I'm rather hesitant to complicate the drawing interfaces in
GDK (for 1.3, this is a VTable that every Drawable implementation
must implement and must also be supported on every platform) 
more than necesary. 


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