[haiku-appserver] Re: another issue. ClipToPicture.

  • From: Stefano Ceccherini <burton666@xxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: 2 Nov 2004 14:20:45 -0000

>> As I said, BView is a friend of BRegion, so you can add the >pixel to the 
>> BRegion data manually, then call >BRegion::Support::SortRects() and 
>> CleanupRegion()...

>       OK, we seem to have the answer.

>> Anyway, if you're interested I can go deeply into the >subject.

>       Yes, please.

Well, basically, you usually construct/operate on BRegion using the class 
methods, though, if we have so many rectangles (every pixel is a rectangle, in 
the case of a BPicture drawn on a B/W "canvas"),
and you know for sure that those rectangles don't intersect with each other, 
you can copy them to BRegion's buffer directly (see 
 , GetClippingRegion() for an example)

In the end, though, after you've "copied" all these rectangles/pixels into a 
BRegion, you end up with a region which is not normalized (i.e. rects aren't 
sorted correctly, nor coalesced/merged). So you have to call 
BRegion::Support::CleanupRegion() and SortRects() on that region (again, never 
do that, unless there is a good reason, since if you forget something, you will 
end up with lots of visual bugs, and usually it's not necessary, and BRegion's 
rects are clipping_rects, not BRects, so you also have to do the conversion 

On further examination, though, I think that it's not libbe which does the 
clipping work for ClipToPicture() (I thought it was BView), but the appserver 
directly. Actually it makes sense, since BPictures are kept server side (right 
? They have a "token" member).

>       Of course, it would be of big help if you can do this >for app_server. 
>:-) ;-)

Eheh, I'll try to have a look when I have time.

Stefano Ceccherini aka Jack Burton
Scegli il tuo dominio preferito e attiva la tua email! Da oggi
l'eMail di superEva e' ancora piu' veloce e ricca di funzioni!

Other related posts: