Article View: comp.windows.x
Article #23805Re: how to XDrawLines > MaxRequestSize
From: Israel Pinkas
Date: Mon, 17 Jun 1991 18:49
Date: Mon, 17 Jun 1991 18:49
60 lines
3151 bytes
3151 bytes
In article <9106142040.AA25972@maui.coral.com> tomt@maui.coral.COM (Tom Tulinsky) writes:
> ) > I hadn't realized that there was a limit to the size of the lists
> ) > that the X poly requests like XDrawLines can handle until recently,
> ) > when I read Kenton Lee's article 'Behind Curtain X' in June's Unix
> ) > Review. Here's some code which will draw lines with an arbitrary
> ) > length array of points.
> )
> ) [code omitted; simply breaks up the list of points, calling XDrawLines
> ) multiple times.]
> )
> ) > A couple of pointed questions:
> ) > - If it's so simple, why can't the Xlib do it for you?
> )
> ) Because it's *not* so simple. Read the protocol spec for the PolyLine
> ) request. In particular, pay close attention to joins and the semantics
> ) of overlapping lines. Your "solution" produces at least the following
> ) violations:
> ) . . .
> Good point, correction accepted. I believe that my for loop will
> satisfy the protocol when the GC function is GXCopy because multiple
> drawing of pixels does not matter in this common case.
Nope. Line joins are not the same as the line ends. The only time your
code will work is if the line join and the line end are both round
(JoinRound and CapRound). There is no way to get the line caps to emulate
JoinBevel or JoinMiter. In addition, CapProjecting and CapRound modify
pixels that the various joins might not modify. This makes things very
painful for wide lines.
Try breaking the following up:
CapProjecting
JoinRound
LineWidth=10
50,50 - 100,50 - 100,100
If you know that the lines are wide, you might be able to cheat in the
GXCopy case be drawing each segment of the line twice, creating a closed
loop. MultiLine requests that form a closed loop are treated as a polygon,
which means that there are no caps, only joins.
Please note that breaking requests apart will not work if the line is
segmented. The segments are supposed to start at the beginning of the line
and go to the end. Breaking the request will cause each part to start the
pattern over.
-Israel Pinkas
Intel Corp
--
--------------------------------------
Disclaimer: The above are my personal opinions, and in no way represent
the opinions of Intel Corporation. In no way should the above be taken
to be a statement of Intel.
UUCP: {amdcad,decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!st860!pinkas
ARPA: pinkas%st860.intel.com@relay.cs.net
CSNET: pinkas@st860.intel.com
Technical Details
Message-ID:
<PINKAS.91Jun17114928@almond.intel.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zephyr.ens.tek.com!tektronix!percy!littlei!intelhf!ichips!inews!pinkasReferences:
<9106122314.AA17431@lightning.McRCIM.McGill.EDU> <9106142040.AA25972@maui.coral.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zephyr.ens.tek.com!tektronix!percy!littlei!intelhf!ichips!inews!pinkas From: pinkas@almond.intel.com (Israel Pinkas) Newsgroups: comp.windows.x Subject: Re: how to XDrawLines > MaxRequestSize Message-ID: <PINKAS.91Jun17114928@almond.intel.com> Date: 17 Jun 91 18:49:28 GMT References: <9106122314.AA17431@lightning.McRCIM.McGill.EDU> <9106142040.AA25972@maui.coral.com> Sender: news@inews.intel.com Organization: Software Technologies, INTeL Corporation, Santa Clara, CA Lines: 60 In-reply-to: tomt@maui.coral.COM's message of 14 Jun 91 20:40:04 GMT