Article View: comp.windows.misc
Article #841Re: simple (dumb?) question
From: Geoff Kuenning
Date: Thu, 25 Feb 1988 08:43
Date: Thu, 25 Feb 1988 08:43
28 lines
1833 bytes
1833 bytes
In article <3132@bloom-beacon.MIT.EDU> tada@athena.mit.edu (Michael Zehr)
writes:
> I've yet to see
> routines like draw_vertical_line, draw_horizontal_line,
> draw_rectangle, etc...Are the draw_line routines
> implemented so efficiently that there wouldn't be much of a speed
> savings by special-casing h. and v. lines? Or is the current design
> philosophy to avoid special cases as much as possible?
Current design avoids special cases at the user level, preferring them
at a lower level. It's easy to detect horizontal and vertical lines
on the fly (because one coordinate matches) and handle them separately.
Horizontal ones are a very big win on software-driven systems, because
you can set a whole memory unit (byte or word) all at once.
> With respect to polygons and rectangles, I've done some work with
> programs that do nothing but tile areas with filled rectangles, and
> I've had to use 4-sided filled polygons. Obviously that takes a lot
> more computation than filling a rectangle.
Not necessarily; again this can easily be detected as a special case.
However, the X Window System (there! I said it right! :-) has separate
calls for drawing filled and unfilled rectangles. (But one could argue
this is a bad idea, since it increases user-level complexity for little
gain.)
--
Geoff Kuenning geoff@ITcorp.com {uunet,trwrb}!desint!geoff
Technical Details
Message-ID:
<1687@desint.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!hplabs!sdcrdcf!trwrb!desint!geoffReferences:
<3132@bloom-beacon.MIT.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!hplabs!sdcrdcf!trwrb!desint!geoff From: geoff@desint.UUCP (Geoff Kuenning) Newsgroups: comp.windows.misc Subject: Re: simple (dumb?) question Message-ID: <1687@desint.UUCP> Date: 25 Feb 88 08:43:19 GMT References: <3132@bloom-beacon.MIT.EDU> Reply-To: geoff@desint.UUCP (Geoff Kuenning) Organization: Interrupt Technology Corp., Manhattan Beach, CA Lines: 27