[haiku-appserver] Re: update code.

  • From: Adi Oanca <adioanca@xxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Thu, 31 Mar 2005 00:16:56 +0300

Stephan Assmus wrote:
> 
> the views now actually draw themselves, so the situation has much 
> improved in that regard.

        They did? How?
        Tonight I just tested with your 'Window' application and the BView 
inside the window did not draw correctly.

> 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.
> Or do you mean this:

        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, 
> buffer->
> Height() - 1));
>                               fPainter->ConstrainClipping(all);
>                       } else {
>                               fPainter->ConstrainClipping(*region);
>                       }
>               Unlock();
>       }
        else if (!region)
        {
                BRegion all;
                RenderingBuffer* buffer = BackBuffer();
                all.Include(BRect(0, 0, buffer->Width() - 1,
                        buffer->Height() - 1));
                fPainter->ConstrainClipping(all);
                // same as the region is invalid.
        }
> }
> 
> 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.

        What about the 2nd version?

> 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.

        :-) Have a look at this:
http://www.freelists.org/archives/haiku-appserver/01-2005/msg00019.html


bye,
Adi.

Other related posts: