diff --git a/src/tests/servers/app/newClipping/Clipping.proj b/src/tests/servers/app/newClipping/Clipping.proj index 1ebb697a9b..37bc87d83b 100644 Binary files a/src/tests/servers/app/newClipping/Clipping.proj and b/src/tests/servers/app/newClipping/Clipping.proj differ diff --git a/src/tests/servers/app/newClipping/Layer.cpp b/src/tests/servers/app/newClipping/Layer.cpp index 3d3b40c3ce..22de7680e5 100644 --- a/src/tests/servers/app/newClipping/Layer.cpp +++ b/src/tests/servers/app/newClipping/Layer.cpp @@ -501,6 +501,7 @@ 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 @@ -514,6 +515,11 @@ void Layer::rebuild_visible_regions(const BRegion &invalid, { // we have something to include to our fullVisible. It may already be in // there, but we'll never know. + +// TODO: further analyze the next 2 lines. + fFullVisible.Exclude(&invalid); + fVisible.Exclude(&invalid); + fFullVisible.Include(&common); } else @@ -585,6 +591,8 @@ void Layer::clear_visible_regions() void Layer::PrintToStream() const { printf("-> %s\n", fName); + fVisible.PrintToStream(); + fFullVisible.PrintToStream(); for (Layer *child = VirtualBottomChild(); child; child = VirtualUpperSibling()) child->PrintToStream(); diff --git a/src/tests/servers/app/newClipping/main.cpp b/src/tests/servers/app/newClipping/main.cpp index ed2852a9c5..e07fdad1c0 100644 --- a/src/tests/servers/app/newClipping/main.cpp +++ b/src/tests/servers/app/newClipping/main.cpp @@ -118,7 +118,7 @@ void clsMainWindow::test1() c.red = rand()/256; c.green = rand()/256; c.blue = rand()/256; - Layer *lay12 = new Layer(BRect(170,20,290,150), "lay21", + Layer *lay12 = new Layer(BRect(170,20,290,150), "lay12", B_FOLLOW_NONE, B_FULL_UPDATE_ON_RESIZE, c); lay1->AddLayer(lay12); @@ -126,7 +126,7 @@ void clsMainWindow::test1() c.red = rand()/256; c.green = rand()/256; c.blue = rand()/256; - Layer *lay13 = new Layer(BRect(20,20,100,100), "lay31", + Layer *lay13 = new Layer(BRect(20,20,100,100), "lay13", B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, 0, c); lay12->AddLayer(lay13);