From 9a92483e6fda2d391fff201b452f4c7b7f056399 Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Mon, 30 May 2005 14:00:45 +0000 Subject: [PATCH] made things clearer, removed a useless exclude operation git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12901 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../servers/app/newClipping/Clipping.proj | Bin 12308 -> 12308 bytes src/tests/servers/app/newClipping/Layer.cpp | 38 ++++-------------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/tests/servers/app/newClipping/Clipping.proj b/src/tests/servers/app/newClipping/Clipping.proj index 37bc87d83b4f45785af5c1d02ed46a99ea4f6d1e..4effe88a2556dee0852829a5ac4b185c97a97e7f 100644 GIT binary patch delta 37 vcmV+=0NVeQV3c66zy<`E?;3!UpbbH@1qb;g17zwRvjHsk0RaKC`7Ij)CKV1K delta 37 tcmbP|FePEb0XCL|NU4U&3wRwjv$FqGVV=USxS3JsJ0l~*=AXLKOaKMk450u3 diff --git a/src/tests/servers/app/newClipping/Layer.cpp b/src/tests/servers/app/newClipping/Layer.cpp index 22de7680e5..a0516a1c02 100644 --- a/src/tests/servers/app/newClipping/Layer.cpp +++ b/src/tests/servers/app/newClipping/Layer.cpp @@ -493,7 +493,7 @@ void Layer::rebuild_visible_regions(const BRegion &invalid, // no need to go deeper if the parent doesn't have a visible region anymore // and our fullVisible region is also empty. - if (!parentLocalVisible.Frame().IsValid() && !fFullVisible.Frame().IsValid()) + if (!parentLocalVisible.Frame().IsValid() && !(fFullVisible.CountRects() > 0)) return; bool fullRebuild = false; @@ -501,42 +501,22 @@ void Layer::rebuild_visible_regions(const BRegion &invalid, // intersect maximum wanted region with the invalid region BRegion common; set_user_regions(common); - common.IntersectWith(&invalid); + // if the resulted region is not valid, this layer is not in the catchment area // of the region being invalidated - if (!common.Frame().IsValid()) + if (!common.CountRects() > 0) return; // now intersect with parent's visible part of the region that was/is invalidated common.IntersectWith(&parentLocalVisible); - if (common.Frame().IsValid()) - { - // we have something to include to our fullVisible. It may already be in - // there, but we'll never know. + // exclude the invalid region + fFullVisible.Exclude(&invalid); + fVisible.Exclude(&invalid); -// TODO: further analyze the next 2 lines. - fFullVisible.Exclude(&invalid); - fVisible.Exclude(&invalid); - - fFullVisible.Include(&common); - } - else - { - // this layer is in the catchment area of the region being invalidated, - // yet it will have no new visible area attached to it. It means - // this layer was overshaddowed by those above it and any visible area - // that it may have common with the region being invalidated, must be - // excluded from it's fFullVisible and fVisible regions. - fFullVisible.Exclude(&invalid); - fVisible.Exclude(&invalid); - // we don't return here becase we want the same thing to happen to all - // our children. - - // Don't worry about the last line from this method, it will do nothing - - // common is invalid. Same goes for the last two in the 'for' statement below. - } + // put in what's really visible + fFullVisible.Include(&common); // this is to allow a layer to hide some parts of itself so children // won't take them. @@ -553,8 +533,6 @@ void Layer::rebuild_visible_regions(const BRegion &invalid, // to let children know much they can take from parent's visible region common.Exclude(&lay->fFullVisible); - // all that a child took must be excluded from our visible region - fVisible.Exclude(&lay->fFullVisible); // we've hidden some parts of our visible region from our children, // and we must be in sysnc with this region too... if (altered)