[haiku-appserver] Re: update code.

  • From: "Stephan Assmus" <superstippi@xxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Wed, 30 Mar 2005 22:58:31 +0200 CEST

Hello Adi,

>       Now, this appears to function well, but I need something from 
> DisplayDriver to work perfectly.
>       I need DisplayDriver subclasses to implement 
> ConstainClippingRegion() 
> and _completely_ ignore LayerData::clipReg.

the views now actually draw themselves, so the situation has much 
improved in that regard. What I don't understand is this:

>       ConstainClippingRegion() should function like BView's version, with 
> a 
> minor difference - passing an empty region should be handled exactly 
> like when passing NULL.

Do you mean like this:

// ConstrainClippingRegion
void DisplayDriverPainter::ConstrainClippingRegion(BRegion *region)
        if (Lock()) {
                if (region) {
                } else {
                        BRegion empty;

Or do you mean this:

// ConstrainClippingRegion
void DisplayDriverPainter::ConstrainClippingRegion(BRegion *region)
        if (region && Lock()) {
                        if (!region->Frame().IsValid()) {
                                BRegion all;
                                RenderingBuffer* buffer = BackBuffer();
                                all.Include(BRect(0, 0, buffer->Width() - 1, 
Height() - 1));
                        } else {

The first version is more restrictive, so that's what I have tried, but 
it doesn't work well. The clipping in the WindowBorder seems to work, 
but the clipping in the views is like non-existent.

>       Now, about CopyRegionList() I will explain this tomorrow as I'm 
> pretty 
> tired. I can give you a hint, it's _really_useful when resizing a 
> window 
> with lots of views(aligned to center or right) inside it. BTW, this 
> is 
> one area where our app_server does better that R5's one, as that 
> completely redraws center or right aligned views (tested that). It 
> can 
> do better if that method would be optimized, as there is _plenty_ of 
> room to do that. :-)

Ok, now I understand it better. But I think if it is indeed used like 
that, it should not be part of the DisplayDriver API. For the simple 
reason that such a function should only be part of the API if the 
regions are guarenteed not to overlap. ie, they are all transfered with 
the same offset (no point list, just a single BPoint offset). Because 
if this requirement is not met, it means that views need to be 
invalidated, and that is not the job of the DisplayDriver to do.

Best regards,

Other related posts: