[Xr] Re: Rectangle operators

Bill Spitzak spitzak at d2.com
Thu Jun 5 10:44:46 PDT 2003

On Wednesday 04 June 2003 07:12 pm, Carl Worth wrote:
> On Jun 4, Bill Spitzak wrote:
>  > However a possibly better solution than my proposal is somewhat
>  > in-between. Add only a single call that adds a rectangle to the current
>  > path.
> That's already there, (as I mentioned above). It is:
> 	void
> 	XrRectangle (XrState *xrs,
> 	             double x, double y,
> 	             double width, double height);

I missed that, sorry, that does exactly what I was thinking. Current 
implementation just does moveto/lineto, but it would not be hard to have Xr 
store the rectangle itself internally and do special code if no calls other 
than rectangles were used to build the path.

The rectangle is built counter-clockwise if the sign of the width and height 
are the same, and clockwise if the signs are different. Watch out that any 
accelerated version has the same behavior (it makes a difference if the 
rectangles intersect). Easy way would be to fall back on normal slow path 
behavior if the cw/ccw state of all the rectangles do not match.

I believe that accelerating this call, and adding either an "XrInvertPath" or 
a "XrClipOut" call so that rectangles can be removed from a region, are all 
that is needed to make Xr run as sufficient speed to be usable for 
toolkit-level GUI.

PS: Sorry I have not gotten the entire interface figured out yet. I have been 
unable to compile Xr because it requires a newer X server than I have on the 
machines at work and I'm not allowed to change their configuration (the 
machine I have at home is out of the question, it's like 8 years old!)

                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com

More information about the cairo mailing list