[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Region handling added to Microwindows
From: Greg Haerr ####@####.#### Date: 22 Oct 1999 21:34:43 -0000 Message-Id: <01BF1CA2.D6DF2090.greg@censoft.com> : > The answer to the latter is having the engine chop each portion of the bitblit : > rectangle into completely visible regions, and recursively calling bitblit on : > that rectangle : You may want to look at X11 here. X has a nice algorithm that builds a : rectangle list from a set of clipping data and tends to output lots of wide : rectangles. Alan - I have taken the X11 region handling code and almost completely integrated it into Microwindows. You're right - the y-x-banding algorithm that X11 uses is complicated, but allows the same base routine to be used to perform region intersection, difference, xor, and union. It produces a dynamically allocated data structure that is an array of rectangles, arranged in identical-height "bands" that allow the routine to be concerned only with the left and right sides of each rectangle, per band. The width of the rectangles in each band are maximized, so that it will work well for a fast recursive bit blitter. Anyway, the region handling that I've implemented currently only builds regions, I'm not yet actually using it for clipping. The reason for this is that the existing clipping routine, written originally by David Bell, although not dynamically allocated and stuck to being single-instance, caches the last-checked clip region, whereas X11 requires for-looping. In addition, the clip processing is enhanced in Bell's code and returns CLIP_VISIBLE, CLIP_INVISIBLE or CLIP_PARTIAL, rather than true or false. So, after getting this stuff worked out, we'll have fast clipped bitblit, as well as fun with round rectangles... Greg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |