renamed a few members so that I don't have problems later. removed more methods/members
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13190 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+61
-42
@@ -83,14 +83,22 @@ Layer::Layer(BRect frame, const char* name, int32 token,
|
|||||||
fCurrent(NULL),
|
fCurrent(NULL),
|
||||||
|
|
||||||
// all regions (fVisible, fFullVisible, fFull) start empty
|
// all regions (fVisible, fFullVisible, fFull) start empty
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
fVisible(),
|
fVisible(),
|
||||||
fFullVisible(),
|
fFullVisible(),
|
||||||
|
#else
|
||||||
|
fVisible2(),
|
||||||
|
fFullVisible2(),
|
||||||
|
#endif
|
||||||
#ifndef NEW_CLIPPING
|
#ifndef NEW_CLIPPING
|
||||||
fFull(),
|
fFull(),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
fClipReg(&fVisible),
|
fClipReg(&fVisible),
|
||||||
|
#else
|
||||||
|
fClipReg(&fVisible2),
|
||||||
|
#endif
|
||||||
fServerWin(NULL),
|
fServerWin(NULL),
|
||||||
fName(new BString(name)),
|
fName(new BString(name)),
|
||||||
fViewToken(token),
|
fViewToken(token),
|
||||||
@@ -296,11 +304,11 @@ Layer::RemoveChild(Layer *layer)
|
|||||||
// 2.3) we were removed from the main tree so clear our full region.
|
// 2.3) we were removed from the main tree so clear our full region.
|
||||||
#ifndef NEW_CLIPPING
|
#ifndef NEW_CLIPPING
|
||||||
c->fFull.MakeEmpty();
|
c->fFull.MakeEmpty();
|
||||||
#endif
|
|
||||||
// 2.4) clear fullVisible region.
|
// 2.4) clear fullVisible region.
|
||||||
c->fFullVisible.MakeEmpty();
|
c->fFullVisible.MakeEmpty();
|
||||||
// 2.5) we don't have a visible region anymore.
|
// 2.5) we don't have a visible region anymore.
|
||||||
c->fVisible.MakeEmpty();
|
c->fVisible.MakeEmpty();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// tree parsing algorithm
|
// tree parsing algorithm
|
||||||
@@ -407,6 +415,7 @@ Layer::FindLayer(const int32 token)
|
|||||||
Layer*
|
Layer*
|
||||||
Layer::LayerAt(const BPoint &pt)
|
Layer::LayerAt(const BPoint &pt)
|
||||||
{
|
{
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
if (fVisible.Contains(pt))
|
if (fVisible.Contains(pt))
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
@@ -418,7 +427,7 @@ Layer::LayerAt(const BPoint &pt)
|
|||||||
return lay;
|
return lay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -931,9 +940,10 @@ Layer::Hide(bool invalidate)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
fHidden = true;
|
fHidden = true;
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
GetRootLayer()->GoInvalidate(this, fFullVisible);
|
GetRootLayer()->GoInvalidate(this, fFullVisible);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns true if the layer is hidden
|
//! Returns true if the layer is hidden
|
||||||
@@ -1271,7 +1281,9 @@ Layer::PrintNode()
|
|||||||
printf("Bottom child: %s (%p)\n",fBottomChild->GetName(), fBottomChild);
|
printf("Bottom child: %s (%p)\n",fBottomChild->GetName(), fBottomChild);
|
||||||
else
|
else
|
||||||
printf("Bottom child: NULL\n");
|
printf("Bottom child: NULL\n");
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
printf("Visible Areas: "); fVisible.PrintToStream();
|
printf("Visible Areas: "); fVisible.PrintToStream();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Prints the tree hierarchy from the current layer down
|
//! Prints the tree hierarchy from the current layer down
|
||||||
@@ -1349,12 +1361,12 @@ return;
|
|||||||
}
|
}
|
||||||
#ifndef NEW_CLIPPING
|
#ifndef NEW_CLIPPING
|
||||||
fParent->StartRebuildRegions(BRegion(rect), this, B_LAYER_MOVE, pt);
|
fParent->StartRebuildRegions(BRegion(rect), this, B_LAYER_MOVE, pt);
|
||||||
#endif
|
|
||||||
|
|
||||||
fDriver->CopyRegionList(&fRootLayer->fCopyRegList,
|
fDriver->CopyRegionList(&fRootLayer->fCopyRegList,
|
||||||
&fRootLayer->fCopyList,
|
&fRootLayer->fCopyList,
|
||||||
fRootLayer->fCopyRegList.CountItems(),
|
fRootLayer->fCopyRegList.CountItems(),
|
||||||
&fFullVisible);
|
&fFullVisible);
|
||||||
|
#endif
|
||||||
|
|
||||||
fParent->Redraw(fRootLayer->fRedrawReg, this);
|
fParent->Redraw(fRootLayer->fRedrawReg, this);
|
||||||
|
|
||||||
@@ -1394,9 +1406,10 @@ return;
|
|||||||
}
|
}
|
||||||
#ifndef NEW_CLIPPING
|
#ifndef NEW_CLIPPING
|
||||||
fParent->StartRebuildRegions(BRegion(rect), this, B_LAYER_RESIZE, pt);
|
fParent->StartRebuildRegions(BRegion(rect), this, B_LAYER_RESIZE, pt);
|
||||||
#endif
|
|
||||||
|
|
||||||
fDriver->CopyRegionList(&fRootLayer->fCopyRegList, &fRootLayer->fCopyList, fRootLayer->fCopyRegList.CountItems(), &fFullVisible);
|
fDriver->CopyRegionList(&fRootLayer->fCopyRegList, &fRootLayer->fCopyList, fRootLayer->fCopyRegList.CountItems(), &fFullVisible);
|
||||||
|
#endif
|
||||||
|
|
||||||
fParent->Redraw(fRootLayer->fRedrawReg, this);
|
fParent->Redraw(fRootLayer->fRedrawReg, this);
|
||||||
|
|
||||||
SendViewCoordUpdateMsg();
|
SendViewCoordUpdateMsg();
|
||||||
@@ -1467,7 +1480,11 @@ Layer::RequestDraw(const BRegion ®, Layer *startFrom)
|
|||||||
if (HasClient() && IsTopLayer()) {
|
if (HasClient() && IsTopLayer()) {
|
||||||
// calculate the minimum region/rectangle to be updated with
|
// calculate the minimum region/rectangle to be updated with
|
||||||
// a single message to the client.
|
// a single message to the client.
|
||||||
BRegion updateReg(fFullVisible);
|
BRegion updateReg
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
|
(fFullVisible)
|
||||||
|
#endif
|
||||||
|
;
|
||||||
if (fFlags & B_FULL_UPDATE_ON_RESIZE
|
if (fFlags & B_FULL_UPDATE_ON_RESIZE
|
||||||
#ifndef NEW_CLIPPING
|
#ifndef NEW_CLIPPING
|
||||||
&& fFrameAction == B_LAYER_ACTION_RESIZE
|
&& fFrameAction == B_LAYER_ACTION_RESIZE
|
||||||
@@ -1492,6 +1509,7 @@ if (fOwner->cnt != 1)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
if (fVisible.CountRects() > 0) {
|
if (fVisible.CountRects() > 0) {
|
||||||
BRegion updateReg(fVisible);
|
BRegion updateReg(fVisible);
|
||||||
// calculate the update region
|
// calculate the update region
|
||||||
@@ -1512,7 +1530,7 @@ if (fOwner->cnt != 1)
|
|||||||
fDriver->ConstrainClippingRegion(NULL);
|
fDriver->ConstrainClippingRegion(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
for (Layer *lay = BottomChild(); lay != NULL; lay = UpperSibling()) {
|
for (Layer *lay = BottomChild(); lay != NULL; lay = UpperSibling()) {
|
||||||
if (lay == startFrom)
|
if (lay == startFrom)
|
||||||
redraw = true;
|
redraw = true;
|
||||||
@@ -1520,12 +1538,13 @@ if (fOwner->cnt != 1)
|
|||||||
if (redraw && !(lay->IsHidden())) {
|
if (redraw && !(lay->IsHidden())) {
|
||||||
// no need to go deeper if not even the FullVisible region intersects
|
// no need to go deeper if not even the FullVisible region intersects
|
||||||
// Update one.
|
// Update one.
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
BRegion common(lay->fFullVisible);
|
BRegion common(lay->fFullVisible);
|
||||||
common.IntersectWith(®);
|
common.IntersectWith(®);
|
||||||
|
|
||||||
if (common.CountRects() > 0)
|
if (common.CountRects() > 0)
|
||||||
lay->RequestDraw(reg, NULL);
|
lay->RequestDraw(reg, NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1639,7 +1658,7 @@ Layer::do_Hide()
|
|||||||
|
|
||||||
if (fParent && !fParent->IsHidden() && GetRootLayer()) {
|
if (fParent && !fParent->IsHidden() && GetRootLayer()) {
|
||||||
// save fullVisible so we know what to invalidate
|
// save fullVisible so we know what to invalidate
|
||||||
BRegion invalid(fFullVisible);
|
BRegion invalid(fFullVisible2);
|
||||||
|
|
||||||
clear_visible_regions();
|
clear_visible_regions();
|
||||||
|
|
||||||
@@ -1666,7 +1685,7 @@ Layer::do_Show()
|
|||||||
void
|
void
|
||||||
Layer::do_Invalidate(const BRegion &invalid, const Layer *startFrom)
|
Layer::do_Invalidate(const BRegion &invalid, const Layer *startFrom)
|
||||||
{
|
{
|
||||||
BRegion localVisible(fFullVisible);
|
BRegion localVisible(fFullVisible2);
|
||||||
localVisible.IntersectWith(&invalid);
|
localVisible.IntersectWith(&invalid);
|
||||||
rebuild_visible_regions(invalid, localVisible,
|
rebuild_visible_regions(invalid, localVisible,
|
||||||
startFrom? startFrom: BottomChild());
|
startFrom? startFrom: BottomChild());
|
||||||
@@ -1762,7 +1781,7 @@ Layer::rezize_layer_redraw_more(BRegion ®, float dx, float dy)
|
|||||||
lay->ConvertToScreen2(®Z);
|
lay->ConvertToScreen2(®Z);
|
||||||
|
|
||||||
// intersect that with this'(not lay's) fullVisible region
|
// intersect that with this'(not lay's) fullVisible region
|
||||||
regZ.IntersectWith(&fFullVisible);
|
regZ.IntersectWith(&fFullVisible2);
|
||||||
reg.Include(®Z);
|
reg.Include(®Z);
|
||||||
|
|
||||||
lay->rezize_layer_redraw_more(reg,
|
lay->rezize_layer_redraw_more(reg,
|
||||||
@@ -1770,7 +1789,7 @@ Layer::rezize_layer_redraw_more(BRegion ®, float dx, float dy)
|
|||||||
(rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM? dy: 0);
|
(rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM? dy: 0);
|
||||||
|
|
||||||
// above, OR this:
|
// above, OR this:
|
||||||
// reg.Include(&lay->fFullVisible);
|
// reg.Include(&lay->fFullVisible2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (((rm & 0x0F0F) == (uint16)B_FOLLOW_RIGHT && dx != 0) ||
|
if (((rm & 0x0F0F) == (uint16)B_FOLLOW_RIGHT && dx != 0) ||
|
||||||
@@ -1778,7 +1797,7 @@ Layer::rezize_layer_redraw_more(BRegion ®, float dx, float dy)
|
|||||||
((rm & 0xF0F0) == (uint16)B_FOLLOW_BOTTOM && dy != 0)||
|
((rm & 0xF0F0) == (uint16)B_FOLLOW_BOTTOM && dy != 0)||
|
||||||
((rm & 0xF0F0) == (uint16)B_FOLLOW_V_CENTER && dy != 0))
|
((rm & 0xF0F0) == (uint16)B_FOLLOW_V_CENTER && dy != 0))
|
||||||
{
|
{
|
||||||
reg.Include(&lay->fFullVisible);
|
reg.Include(&lay->fFullVisible2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1793,8 +1812,8 @@ Layer::resize_layer_full_update_on_resize(BRegion ®, float dx, float dy)
|
|||||||
uint16 rm = lay->fResizeMode & 0x0000FFFF;
|
uint16 rm = lay->fResizeMode & 0x0000FFFF;
|
||||||
|
|
||||||
if ((rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT || (rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM) {
|
if ((rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT || (rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM) {
|
||||||
if (lay->fFlags & B_FULL_UPDATE_ON_RESIZE && lay->fVisible.CountRects() > 0)
|
if (lay->fFlags & B_FULL_UPDATE_ON_RESIZE && lay->fVisible2.CountRects() > 0)
|
||||||
reg.Include(&lay->fVisible);
|
reg.Include(&lay->fVisible2);
|
||||||
|
|
||||||
lay->resize_layer_full_update_on_resize(reg,
|
lay->resize_layer_full_update_on_resize(reg,
|
||||||
(rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT? dx: 0,
|
(rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT? dx: 0,
|
||||||
@@ -1817,9 +1836,9 @@ Layer::do_ResizeBy(float dx, float dy)
|
|||||||
ResizedByHook(dx, dy, false); // manual
|
ResizedByHook(dx, dy, false); // manual
|
||||||
|
|
||||||
if (!IsHidden() && GetRootLayer()) {
|
if (!IsHidden() && GetRootLayer()) {
|
||||||
BRegion oldFullVisible(fFullVisible);
|
BRegion oldFullVisible(fFullVisible2);
|
||||||
// this is required to invalidate the old border
|
// this is required to invalidate the old border
|
||||||
BRegion oldVisible(fVisible);
|
BRegion oldVisible(fVisible2);
|
||||||
|
|
||||||
// in case they moved, bottom, right and center aligned layers must be redrawn
|
// in case they moved, bottom, right and center aligned layers must be redrawn
|
||||||
BRegion redrawMore;
|
BRegion redrawMore;
|
||||||
@@ -1828,7 +1847,7 @@ Layer::do_ResizeBy(float dx, float dy)
|
|||||||
// we'll invalidate the old area and the new, maxmial one.
|
// we'll invalidate the old area and the new, maxmial one.
|
||||||
BRegion invalid;
|
BRegion invalid;
|
||||||
get_user_regions(invalid);
|
get_user_regions(invalid);
|
||||||
invalid.Include(&fFullVisible);
|
invalid.Include(&fFullVisible2);
|
||||||
|
|
||||||
clear_visible_regions();
|
clear_visible_regions();
|
||||||
|
|
||||||
@@ -1838,11 +1857,11 @@ Layer::do_ResizeBy(float dx, float dy)
|
|||||||
|
|
||||||
// what's invalid, are the differences between to old and the new fullVisible region
|
// what's invalid, are the differences between to old and the new fullVisible region
|
||||||
// 1) in case we grow.
|
// 1) in case we grow.
|
||||||
BRegion redrawReg(fFullVisible);
|
BRegion redrawReg(fFullVisible2);
|
||||||
redrawReg.Exclude(&oldFullVisible);
|
redrawReg.Exclude(&oldFullVisible);
|
||||||
// 2) in case we shrink
|
// 2) in case we shrink
|
||||||
BRegion redrawReg2(oldFullVisible);
|
BRegion redrawReg2(oldFullVisible);
|
||||||
redrawReg2.Exclude(&fFullVisible);
|
redrawReg2.Exclude(&fFullVisible2);
|
||||||
// 3) combine.
|
// 3) combine.
|
||||||
redrawReg.Include(&redrawReg2);
|
redrawReg.Include(&redrawReg2);
|
||||||
|
|
||||||
@@ -1855,10 +1874,10 @@ Layer::do_ResizeBy(float dx, float dy)
|
|||||||
// add redrawReg to our RootLayer's redraw region.
|
// add redrawReg to our RootLayer's redraw region.
|
||||||
GetRootLayer()->fRedrawReg.Include(&redrawReg);
|
GetRootLayer()->fRedrawReg.Include(&redrawReg);
|
||||||
// include layer's visible region in case we want a full update on resize
|
// include layer's visible region in case we want a full update on resize
|
||||||
if (fFlags & B_FULL_UPDATE_ON_RESIZE && fVisible.Frame().IsValid()) {
|
if (fFlags & B_FULL_UPDATE_ON_RESIZE && fVisible2.Frame().IsValid()) {
|
||||||
resize_layer_full_update_on_resize(GetRootLayer()->fRedrawReg, dx, dy);
|
resize_layer_full_update_on_resize(GetRootLayer()->fRedrawReg, dx, dy);
|
||||||
|
|
||||||
GetRootLayer()->fRedrawReg.Include(&fVisible);
|
GetRootLayer()->fRedrawReg.Include(&fVisible2);
|
||||||
GetRootLayer()->fRedrawReg.Include(&oldVisible);
|
GetRootLayer()->fRedrawReg.Include(&oldVisible);
|
||||||
}
|
}
|
||||||
// clear canvas and set invalid regions for affected WinBorders
|
// clear canvas and set invalid regions for affected WinBorders
|
||||||
@@ -1880,12 +1899,12 @@ void Layer::do_MoveBy(float dx, float dy)
|
|||||||
MovedByHook(dx, dy);
|
MovedByHook(dx, dy);
|
||||||
|
|
||||||
if (!IsHidden() && GetRootLayer()) {
|
if (!IsHidden() && GetRootLayer()) {
|
||||||
BRegion oldFullVisible(fFullVisible);
|
BRegion oldFullVisible(fFullVisible2);
|
||||||
|
|
||||||
// we'll invalidate the old position and the new, maxmial one.
|
// we'll invalidate the old position and the new, maxmial one.
|
||||||
BRegion invalid;
|
BRegion invalid;
|
||||||
get_user_regions(invalid);
|
get_user_regions(invalid);
|
||||||
invalid.Include(&fFullVisible);
|
invalid.Include(&fFullVisible2);
|
||||||
|
|
||||||
clear_visible_regions();
|
clear_visible_regions();
|
||||||
|
|
||||||
@@ -1894,7 +1913,7 @@ void Layer::do_MoveBy(float dx, float dy)
|
|||||||
// done rebuilding regions, now copy common parts and redraw regions that became visible
|
// done rebuilding regions, now copy common parts and redraw regions that became visible
|
||||||
|
|
||||||
// include the actual and the old fullVisible regions. later, we'll exclude the common parts.
|
// include the actual and the old fullVisible regions. later, we'll exclude the common parts.
|
||||||
BRegion redrawReg(fFullVisible);
|
BRegion redrawReg(fFullVisible2);
|
||||||
redrawReg.Include(&oldFullVisible);
|
redrawReg.Include(&oldFullVisible);
|
||||||
|
|
||||||
// offset to layer's new location so that we can calculate the common region.
|
// offset to layer's new location so that we can calculate the common region.
|
||||||
@@ -1905,7 +1924,7 @@ void Layer::do_MoveBy(float dx, float dy)
|
|||||||
|
|
||||||
// by intersecting the old fullVisible offseted to layer's new location, with the current
|
// by intersecting the old fullVisible offseted to layer's new location, with the current
|
||||||
// fullVisible, we'll have the common region which can be copied using HW acceleration.
|
// fullVisible, we'll have the common region which can be copied using HW acceleration.
|
||||||
oldFullVisible.IntersectWith(&fFullVisible);
|
oldFullVisible.IntersectWith(&fFullVisible2);
|
||||||
|
|
||||||
// offset back and instruct the HW to do the actual copying.
|
// offset back and instruct the HW to do the actual copying.
|
||||||
oldFullVisible.OffsetBy(-dx, -dy);
|
oldFullVisible.OffsetBy(-dx, -dy);
|
||||||
@@ -1928,20 +1947,20 @@ Layer::do_ScrollBy(float dx, float dy)
|
|||||||
|
|
||||||
if (!IsHidden() && GetRootLayer()) {
|
if (!IsHidden() && GetRootLayer()) {
|
||||||
// set the region to be invalidated.
|
// set the region to be invalidated.
|
||||||
BRegion invalid(fFullVisible);
|
BRegion invalid(fFullVisible2);
|
||||||
|
|
||||||
clear_visible_regions();
|
clear_visible_regions();
|
||||||
|
|
||||||
rebuild_visible_regions(invalid, invalid, BottomChild());
|
rebuild_visible_regions(invalid, invalid, BottomChild());
|
||||||
|
|
||||||
// for the moment we say that the whole surface needs to be redraw.
|
// for the moment we say that the whole surface needs to be redraw.
|
||||||
BRegion redrawReg(fFullVisible);
|
BRegion redrawReg(fFullVisible2);
|
||||||
|
|
||||||
// offset old region so that we can start comparing.
|
// offset old region so that we can start comparing.
|
||||||
invalid.OffsetBy(dx, dy);
|
invalid.OffsetBy(dx, dy);
|
||||||
|
|
||||||
// compute the common region. we'll use HW acc to copy this to the new location.
|
// compute the common region. we'll use HW acc to copy this to the new location.
|
||||||
invalid.IntersectWith(&fFullVisible);
|
invalid.IntersectWith(&fFullVisible2);
|
||||||
// TODO: uncomment!!!
|
// TODO: uncomment!!!
|
||||||
// GetRootLayer()->CopyRegion(&invalid, -dx, -dy);
|
// GetRootLayer()->CopyRegion(&invalid, -dx, -dy);
|
||||||
|
|
||||||
@@ -1989,7 +2008,7 @@ Layer::get_user_regions(BRegion ®)
|
|||||||
void
|
void
|
||||||
Layer::do_RebuildVisibleRegions(const BRegion &invalid, const Layer *startFrom)
|
Layer::do_RebuildVisibleRegions(const BRegion &invalid, const Layer *startFrom)
|
||||||
{
|
{
|
||||||
BRegion localVisible(fFullVisible);
|
BRegion localVisible(fFullVisible2);
|
||||||
localVisible.IntersectWith(&invalid);
|
localVisible.IntersectWith(&invalid);
|
||||||
rebuild_visible_regions(invalid, localVisible, startFrom);
|
rebuild_visible_regions(invalid, localVisible, startFrom);
|
||||||
}
|
}
|
||||||
@@ -2006,7 +2025,7 @@ Layer::rebuild_visible_regions(const BRegion &invalid,
|
|||||||
|
|
||||||
// no need to go deeper if the parent doesn't have a visible region anymore
|
// no need to go deeper if the parent doesn't have a visible region anymore
|
||||||
// and our fullVisible region is also empty.
|
// and our fullVisible region is also empty.
|
||||||
if (!parentLocalVisible.Frame().IsValid() && !(fFullVisible.CountRects() > 0))
|
if (!parentLocalVisible.Frame().IsValid() && !(fFullVisible2.CountRects() > 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool fullRebuild = false;
|
bool fullRebuild = false;
|
||||||
@@ -2025,11 +2044,11 @@ Layer::rebuild_visible_regions(const BRegion &invalid,
|
|||||||
common.IntersectWith(&parentLocalVisible);
|
common.IntersectWith(&parentLocalVisible);
|
||||||
|
|
||||||
// exclude the invalid region
|
// exclude the invalid region
|
||||||
fFullVisible.Exclude(&invalid);
|
fFullVisible2.Exclude(&invalid);
|
||||||
fVisible.Exclude(&invalid);
|
fVisible2.Exclude(&invalid);
|
||||||
|
|
||||||
// put in what's really visible
|
// put in what's really visible
|
||||||
fFullVisible.Include(&common);
|
fFullVisible2.Include(&common);
|
||||||
|
|
||||||
// this is to allow a layer to hide some parts of itself so children
|
// this is to allow a layer to hide some parts of itself so children
|
||||||
// won't take them.
|
// won't take them.
|
||||||
@@ -2044,19 +2063,19 @@ Layer::rebuild_visible_regions(const BRegion &invalid,
|
|||||||
lay->rebuild_visible_regions(invalid, common, lay->BottomChild());
|
lay->rebuild_visible_regions(invalid, common, lay->BottomChild());
|
||||||
|
|
||||||
// to let children know much they can take from parent's visible region
|
// to let children know much they can take from parent's visible region
|
||||||
common.Exclude(&lay->fFullVisible);
|
common.Exclude(&lay->fFullVisible2);
|
||||||
// we've hidden some parts of our visible region from our children,
|
// we've hidden some parts of our visible region from our children,
|
||||||
// and we must be in sysnc with this region too...
|
// and we must be in sysnc with this region too...
|
||||||
if (altered)
|
if (altered)
|
||||||
unalteredVisible.Exclude(&lay->fFullVisible);
|
unalteredVisible.Exclude(&lay->fFullVisible2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the visible region of this layer is what left after all its children took
|
// the visible region of this layer is what left after all its children took
|
||||||
// what they could.
|
// what they could.
|
||||||
if (altered)
|
if (altered)
|
||||||
fVisible.Include(&unalteredVisible);
|
fVisible2.Include(&unalteredVisible);
|
||||||
else
|
else
|
||||||
fVisible.Include(&common);
|
fVisible2.Include(&common);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -2070,11 +2089,11 @@ void
|
|||||||
Layer::clear_visible_regions()
|
Layer::clear_visible_regions()
|
||||||
{
|
{
|
||||||
// OPT: maybe we should uncomment these lines for performance
|
// OPT: maybe we should uncomment these lines for performance
|
||||||
//if (fFullVisible.CountRects() <= 0)
|
//if (fFullVisible2.CountRects() <= 0)
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
fVisible.MakeEmpty();
|
fVisible2.MakeEmpty();
|
||||||
fFullVisible.MakeEmpty();
|
fFullVisible2.MakeEmpty();
|
||||||
for (Layer *child = BottomChild(); child; child = UpperSibling())
|
for (Layer *child = BottomChild(); child; child = UpperSibling())
|
||||||
child->clear_visible_regions();
|
child->clear_visible_regions();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,9 +268,16 @@ class Layer {
|
|||||||
Layer* fBottomChild;
|
Layer* fBottomChild;
|
||||||
|
|
||||||
mutable Layer* fCurrent;
|
mutable Layer* fCurrent;
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
BRegion fVisible;
|
BRegion fVisible;
|
||||||
BRegion fFullVisible;
|
BRegion fFullVisible;
|
||||||
|
#else
|
||||||
|
private:
|
||||||
|
BRegion fVisible2;
|
||||||
|
BRegion fFullVisible2;
|
||||||
|
protected:
|
||||||
|
#endif
|
||||||
#ifndef NEW_CLIPPING
|
#ifndef NEW_CLIPPING
|
||||||
BRegion fFull;
|
BRegion fFull;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -955,8 +955,10 @@ RootLayer::WinBorderAt(const BPoint& pt) const
|
|||||||
{
|
{
|
||||||
for (int32 i = 0; i < fWinBorderCount; i++)
|
for (int32 i = 0; i < fWinBorderCount; i++)
|
||||||
{
|
{
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
if (fWinBorderList[i]->fFullVisible.Contains(pt))
|
if (fWinBorderList[i]->fFullVisible.Contains(pt))
|
||||||
return fWinBorderList[i];
|
return fWinBorderList[i];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1536,10 +1538,12 @@ void RootLayer::KeyboardEventHandler(int32 code, BPrivate::PortLink& msg)
|
|||||||
#ifdef APPSERVER_ROOTLAYER_SHOW_WORKSPACE_NUMBER
|
#ifdef APPSERVER_ROOTLAYER_SHOW_WORKSPACE_NUMBER
|
||||||
{
|
{
|
||||||
// to draw the current Workspace index on screen.
|
// to draw the current Workspace index on screen.
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
BRegion reg(fVisible);
|
BRegion reg(fVisible);
|
||||||
fDriver->ConstrainClippingRegion(®);
|
fDriver->ConstrainClippingRegion(®);
|
||||||
Draw(reg.Frame());
|
Draw(reg.Frame());
|
||||||
fDriver->ConstrainClippingRegion(NULL);
|
fDriver->ConstrainClippingRegion(NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2053,10 +2057,12 @@ RootLayer::draw_window_tab(WinBorder *exFocus)
|
|||||||
|
|
||||||
if (exFocus && focus != exFocus) {
|
if (exFocus && focus != exFocus) {
|
||||||
// TODO: this line is a hack, decorator is drawn twice.
|
// TODO: this line is a hack, decorator is drawn twice.
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
BRegion reg(exFocus->fVisible);
|
BRegion reg(exFocus->fVisible);
|
||||||
if (focus)
|
if (focus)
|
||||||
reg.Include(&focus->fVisible);
|
reg.Include(&focus->fVisible);
|
||||||
redraw_layer(this, reg);
|
redraw_layer(this, reg);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2068,9 +2074,10 @@ RootLayer::empty_visible_regions(Layer *layer)
|
|||||||
// NOTE: first 'layer' must be a WinBorder
|
// NOTE: first 'layer' must be a WinBorder
|
||||||
Layer *child;
|
Layer *child;
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
layer->fFullVisible.MakeEmpty();
|
layer->fFullVisible.MakeEmpty();
|
||||||
layer->fVisible.MakeEmpty();
|
layer->fVisible.MakeEmpty();
|
||||||
|
#endif
|
||||||
child = layer->BottomChild();
|
child = layer->BottomChild();
|
||||||
while(child) {
|
while(child) {
|
||||||
empty_visible_regions(child);
|
empty_visible_regions(child);
|
||||||
|
|||||||
@@ -803,8 +803,9 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
fCurrentLayer->SetViewColor(RGBColor(c));
|
fCurrentLayer->SetViewColor(RGBColor(c));
|
||||||
|
|
||||||
// TODO: this should not trigger redraw, no?!?
|
// TODO: this should not trigger redraw, no?!?
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->fVisible);
|
myRootLayer->GoRedraw(fCurrentLayer, fCurrentLayer->fVisible);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_LAYER_GET_COLORS:
|
case AS_LAYER_GET_COLORS:
|
||||||
@@ -939,8 +940,9 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
int32 noOfRects;
|
int32 noOfRects;
|
||||||
|
|
||||||
ld = fCurrentLayer->fLayerData;
|
ld = fCurrentLayer->fLayerData;
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
reg = fCurrentLayer->ConvertFromParent(&(fCurrentLayer->fVisible));
|
reg = fCurrentLayer->ConvertFromParent(&(fCurrentLayer->fVisible));
|
||||||
|
#endif
|
||||||
if (ld->ClippingRegion())
|
if (ld->ClippingRegion())
|
||||||
reg.IntersectWith(ld->ClippingRegion());
|
reg.IntersectWith(ld->ClippingRegion());
|
||||||
|
|
||||||
@@ -1449,7 +1451,11 @@ void
|
|||||||
ServerWindow::DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
|
ServerWindow::DispatchGraphicsMessage(int32 code, BPrivate::LinkReceiver &link)
|
||||||
{
|
{
|
||||||
fWinBorder->GetRootLayer()->Lock();
|
fWinBorder->GetRootLayer()->Lock();
|
||||||
BRegion rreg(fCurrentLayer->fVisible);
|
BRegion rreg
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
|
(fCurrentLayer->fVisible)
|
||||||
|
#endif
|
||||||
|
;
|
||||||
if (fWinBorder->fInUpdate)
|
if (fWinBorder->fInUpdate)
|
||||||
rreg.IntersectWith(&fWinBorder->yUpdateReg);
|
rreg.IntersectWith(&fWinBorder->yUpdateReg);
|
||||||
|
|
||||||
@@ -2055,9 +2061,12 @@ ServerWindow::_CopyBits(RootLayer* rootLayer, Layer* layer,
|
|||||||
// are triggering BView::Draw() to be called
|
// are triggering BView::Draw() to be called
|
||||||
// and for these parts only.
|
// and for these parts only.
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
|
|
||||||
// the region that is going to be copied
|
// the region that is going to be copied
|
||||||
BRegion copyRegion(src);
|
BRegion copyRegion(src);
|
||||||
// apply the current clipping of the layer
|
// apply the current clipping of the layer
|
||||||
|
|
||||||
copyRegion.IntersectWith(&layer->fVisible);
|
copyRegion.IntersectWith(&layer->fVisible);
|
||||||
|
|
||||||
// offset the region to the destination
|
// offset the region to the destination
|
||||||
@@ -2080,6 +2089,8 @@ ServerWindow::_CopyBits(RootLayer* rootLayer, Layer* layer,
|
|||||||
// trigger the redraw
|
// trigger the redraw
|
||||||
// rootLayer->GoRedraw(fWinBorder, invalidRegion);
|
// rootLayer->GoRedraw(fWinBorder, invalidRegion);
|
||||||
rootLayer->RequestDraw(invalidRegion, fWinBorder);
|
rootLayer->RequestDraw(invalidRegion, fWinBorder);
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -545,7 +545,11 @@ WinBorder::HighlightDecorator(bool active)
|
|||||||
bool
|
bool
|
||||||
WinBorder::HasPoint(const BPoint& pt) const
|
WinBorder::HasPoint(const BPoint& pt) const
|
||||||
{
|
{
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
return fFullVisible.Contains(pt);
|
return fFullVisible.Contains(pt);
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unimplemented. Hook function for handling when system GUI colors change
|
// Unimplemented. Hook function for handling when system GUI colors change
|
||||||
@@ -643,9 +647,12 @@ WinBorder::QuietlySetFeel(int32 feel)
|
|||||||
click_type
|
click_type
|
||||||
WinBorder::_ActionFor(const PointerEvent& event) const
|
WinBorder::_ActionFor(const PointerEvent& event) const
|
||||||
{
|
{
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
if (fTopLayer->fFullVisible.Contains(event.where))
|
if (fTopLayer->fFullVisible.Contains(event.where))
|
||||||
return DEC_NONE;
|
return DEC_NONE;
|
||||||
else if (fDecorator)
|
else
|
||||||
|
#endif
|
||||||
|
if (fDecorator)
|
||||||
return fDecorator->Clicked(event.where, event.buttons, event.modifiers);
|
return fDecorator->Clicked(event.where, event.buttons, event.modifiers);
|
||||||
else
|
else
|
||||||
return DEC_NONE;
|
return DEC_NONE;
|
||||||
|
|||||||
Reference in New Issue
Block a user