[squeak-dev] How Morohs are rendered
lenglish5 at cox.net
Tue Jan 24 01:57:54 UTC 2012
On 1/23/12 3:52 PM, Bert Freudenberg wrote:
> On 23.01.2012, at 08:38, Lawson English wrote:
>> On the topic of fillrates and software blitters, has anyone considered the use of QuickDraw regions to speed up the process? The patent expired long ago, but the algorithm was designed to allow overlapping windows to work on the original Mac, and was quite speedy. It was only superseded by specialized hardware many years later, but still has potential uses even though no-one bothers to.
> How would that compare to Morphic's clipped top-down drawing, which already is quite a bit more efficient than the usual bottom-up drawing?
> - Bert -
I don't know. QuickDraw regions are basically "sparse bitmps" that are
defined by a clip rectangle + inversion points for the region inside the
rectangle. If you perform a Boolean operation on two rectangles, what
you get is a simple set of inversion points that indicates the start and
end of the resulting irregular region, per scanline. I believe that
simple vector graphics can be designed to make use of the info as well
and in fact, you can make the interior of a line part of a region simply
by drawing into one (if memory serves).
scanlines that are entirely obscured are not included in the inversion
list, only the start and end points of the lines that are partially
obscured are listed, so it is quite space and time efficient for large,
mostly rectangular areas, but pixel-exact for more complicated regions.
A blitter designed to work with QD regions would simply stop (or start)
copying for the pixels and scanlines that are defined by the inversion
points. The resolution of QD regions was for bitmaps no more than 32,000
pixels on a side (sufficient for any monitor or set of monitors
available even today), but it seems plausible that it could be extended
to 32bit-ish sized pixmaps, given the nature of how the inversion points
are defined --this would double the memory used by the region, however.
boolean operations and a "point in region" operation were designed to be
as efficient as possible and were responsible for the relative
snappiness of early macs compared to PCs running windows.
Apple stopped using QD regions when they went with PostScript-based
graphics from NeXT, but there are still possible places where they might
be useable. It is conceivable that a version of QD regions can be
created to define 3D ROIs for medical imaging by extending the region
definition to work with stacks of 2D regions in some way, but that's
More information about the Squeak-dev