[interfacekit] Re: Clipping - what to do, what to do?

[...]

> Yes, and you can still use fill_rect where you can. Draw a line from 50,50 to 
> 250,50 with holes
at 100,50-125,50 and 175,50-200,50. check for every pixel if visible and then 
issue 3 draw_line()
calls.

[...]

>>>  Well, what do you think? Is this algorithm good enough? Other ideas? 
>>> Improvements?

>> I think we can avoid low-level clipping altogether by doing the appropriate 
>> work at higher
levels. 

> What do you mean? High-level clipping only determines the visible regions 
> which is in place and
working. Low-level clipping is responsible for "cutting" instructions to the 
visible area. But you
already know that, so what do you mean?

[...]

>Please tell us how are you going to do the low-level clipping!

In my previously mentioned example code 
(http://home.swiftdsl.com.au/~pcky/beos/cOS.zip
), the high-level clipping determines how Invalidate(BRect rect) is called on 
the BView. The BView
is told re-draw a rect. Therefore, there are never any holes. You clip to the 
rect you give the
BView.

Example. Window 2 is on top of Window 1.

111111
112211
112211
111111

To tell the entire visible Window 1 to redraw we make 4 Invalidate() calls 
a,b,c & d.

AAAAAA
BB..CC
BB..CC
DDDDDD

A,B,C and D are actually determined by the implementation of BRegion. In the 
XFree86
implementation of Region, the have some optimized sorting or the rects so you 
can draw from top to
bottom. The science behind this is explained in the XFree86 source.

http://x2.freedesktop.org/cgi-bin/cvsweb/xserver/xserver/mi/miregion.c?rev=1.2



        
                
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html

Other related posts: