[comp.windows.x] XDrawArc slow

brian@natinst.com (Brian H. Powell) (09/20/89)

     I've been doing a little experimental X programming using the book "X
Window Applications Programming" by Eric F. Johnson and Kevin Reichard.
     I did most of these tests on a 8-bit color Mac IIcx, running A/UX
1.1.1b3.  (X11R3.)  When I ran into the problem below, I tried it on a
monochrome Sun as well.  (generic (non-purdue) X11R3.)

     I came to the example about rubber-banding ovals.  Basically with a
pointer-moved event, you erase the old oval, and draw the new one, using
XDrawArc().
     It's too slow.  I thought it was bad on the Mac taking a second to draw
each arc (about 1.5 inches in diameter).  The sun took longer than that.

     I took a quick glance at the X11R3 source code, but couldn't really
figure out where the PolyArc drawing takes place.

     Question 1:  Why is it so slow?
     Question 2:  Can you give me a pointer to the code that does the actual
		  drawing?

     Please mail responses; I'll summarize if there's enough interest.  Thanks
in advance.

Brian H. Powell					National Instruments Corp.
	brian@natinst.com			12109 Technology Blvd.
	uunet!cs.utexas.edu!natinst!brian	Austin, Texas 78727-6204
	AppleLink:NATINST			(512) 250-9119

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (09/20/89)

    Why is it so slow?

Because drawing wide-line arcs is hard to do fast while matching the
protocol specification, and there is no optimization for thin-line
arcs in the R3 server.  Fast thin-line arc code will exist in R4.

    Can you give me a pointer to the code that does the actual drawing?

server/ddx/mi/miarc.c, if you are really want to get depressed.

martin@citi.umich.edu (Martin Friedmann) (09/21/89)

Mark Moraes (moraes@csri.toronto.edu) supplies a client side hack file which
does fast arcs by sending a Polyline instead of an XDrawArc request.  It is
called arc.c and is included in the xpic.tar.Z program on expo.lcs.mit.edu.
arc.c is likely sitting on the pub ftp server at ai.toronto.edu

ai.toronto.edu:/pub/X/arc.c or something

Marty.

--

Marty.