There was too much debug output for regions rebuilding

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11742 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca
2005-03-14 20:59:00 +00:00
parent c81edd87b5
commit 89bdde9df1
+39 -69
View File
@@ -50,7 +50,7 @@
# define STRACE(x) ; # define STRACE(x) ;
#endif #endif
//#define DEBUG_LAYER_REBUILD #define DEBUG_LAYER_REBUILD
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
# define RBTRACE(x) printf x # define RBTRACE(x) printf x
#else #else
@@ -787,13 +787,13 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
{ {
case B_LAYER_NONE: case B_LAYER_NONE:
{ {
RBTRACE(("1) Action B_LAYER_NONE\n")); RBTRACE(("1) Layer(%s): Action B_LAYER_NONE\n", GetName()));
oldRegion = fVisible; oldRegion = fVisible;
break; break;
} }
case B_LAYER_MOVE: case B_LAYER_MOVE:
{ {
RBTRACE(("1) Action B_LAYER_MOVE\n")); RBTRACE(("1) Layer(%s): Action B_LAYER_MOVE\n", GetName()));
oldRegion = fFullVisible; oldRegion = fFullVisible;
fFrame.OffsetBy(pt.x, pt.y); fFrame.OffsetBy(pt.x, pt.y);
fFull.OffsetBy(pt.x, pt.y); fFull.OffsetBy(pt.x, pt.y);
@@ -806,14 +806,14 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
} }
case B_LAYER_SIMPLE_MOVE: case B_LAYER_SIMPLE_MOVE:
{ {
RBTRACE(("1) Action B_LAYER_SIMPLE_MOVE\n")); RBTRACE(("1) Layer(%s): Action B_LAYER_SIMPLE_MOVE\n", GetName()));
fFull.OffsetBy(pt.x, pt.y); fFull.OffsetBy(pt.x, pt.y);
break; break;
} }
case B_LAYER_RESIZE: case B_LAYER_RESIZE:
{ {
RBTRACE(("1) Action B_LAYER_RESIZE\n")); RBTRACE(("1) Layer(%s): Action B_LAYER_RESIZE\n", GetName()));
oldRegion = fVisible; oldRegion = fVisible;
fFrame.right += pt.x; fFrame.right += pt.x;
@@ -828,7 +828,7 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
} }
case B_LAYER_MASK_RESIZE: case B_LAYER_MASK_RESIZE:
{ {
RBTRACE(("1) Action B_LAYER_MASK_RESIZE\n")); RBTRACE(("1) Layer(%s): Action B_LAYER_MASK_RESIZE\n", GetName()));
oldRegion = fVisible; oldRegion = fVisible;
BPoint offset, rSize; BPoint offset, rSize;
@@ -879,19 +879,8 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
fFullVisible.MakeEmpty(); fFullVisible.MakeEmpty();
fVisible = fFull; fVisible = fFull;
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("\n ======= Layer(%s):: RR ****** ======\n", GetName()); printf("Layer(%s) real action START\n", GetName());
fFull.PrintToStream(); fFull.PrintToStream();
fVisible.PrintToStream();
printf("\n ======= Layer(%s):: RR ****** END ======\n", GetName());
if (!fParent)
printf("\t NO parent\n");
else
printf("\t VALID Parent: %s.\n", fParent->GetName());
if (!(fVisible.CountRects() > 0))
printf("\t NO visible area!\n");
else
printf("\t VALID visble area\n");
#endif #endif
if (fParent && fVisible.CountRects() > 0) if (fParent && fVisible.CountRects() > 0)
@@ -900,9 +889,7 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
if (fParent->fAdFlags & B_LAYER_CHILDREN_DEPENDANT) if (fParent->fAdFlags & B_LAYER_CHILDREN_DEPENDANT)
{ {
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("\n ======= Layer(%s)::B_LAYER_CHILDREN_DEPENDANT Parent ======\n", GetName()); printf(" B_LAYER_CHILDREN_DEPENDANT Parent\n");
fFull.PrintToStream();
fVisible.PrintToStream();
#endif #endif
// because we're skipping one level, we need to do out // because we're skipping one level, we need to do out
@@ -912,45 +899,27 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
if (fParent->fParent) if (fParent->fParent)
fVisible.IntersectWith(&(fParent->fParent->fVisible)); fVisible.IntersectWith(&(fParent->fParent->fVisible));
#ifdef DEBUG_LAYER_REBUILD
fVisible.PrintToStream();
#endif
// exclude parent's visible area which could be composed by // exclude parent's visible area which could be composed by
// prior siblings' visible areas. // prior siblings' visible areas.
if (fVisible.CountRects() > 0) if (fVisible.CountRects() > 0)
fVisible.Exclude(&(fParent->fVisible)); fVisible.Exclude(&(fParent->fVisible));
#ifdef DEBUG_LAYER_REBUILD
fVisible.PrintToStream();
#endif
// we have a final visible area. Include it to our parent's one, // we have a final visible area. Include it to our parent's one,
// exclude from parent's parent. // exclude from parent's parent.
if (fVisible.CountRects() > 0) if (fVisible.CountRects() > 0)
{ {
fParent->fFullVisible.Include(&fVisible); fParent->fFullVisible.Include(&fVisible);
#ifdef DEBUG_LAYER_REBUILD
fParent->fFullVisible.PrintToStream();
#endif
if (fParent->fParent) if (fParent->fParent)
fParent->fParent->fVisible.Exclude(&fVisible); fParent->fParent->fVisible.Exclude(&fVisible);
#ifdef DEBUG_LAYER_REBUILD
fParent->fParent->fVisible.PrintToStream();
#endif
} }
#ifdef DEBUG_LAYER_REBUILD
printf("\n ======= Layer(%s)::B_LAYER_CHILDREN_DEPENDANT Parent END ======\n", GetName());
#endif
} }
else else
{ {
// for 95+% of cases // for 95+% of cases
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("\n ======= Layer(%s):: (!)B_LAYER_CHILDREN_DEPENDANT Parent ======\n", GetName()); printf(" (!)B_LAYER_CHILDREN_DEPENDANT Parent\n");
#endif #endif
// the visible area is the one common with parent's one. // the visible area is the one common with parent's one.
@@ -968,12 +937,21 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
for(Layer *lay = VirtualBottomChild(); lay != NULL; lay = VirtualUpperSibling()) for(Layer *lay = VirtualBottomChild(); lay != NULL; lay = VirtualUpperSibling())
lay->RebuildRegions(reg, newAction, newPt, newOffset); lay->RebuildRegions(reg, newAction, newPt, newOffset);
#ifdef DEBUG_LAYER_REBUILD
printf("\nLayer(%s) ALMOST done regions:\n", GetName());
printf("\tVisible Region:\n");
fVisible.PrintToStream();
printf("\tFull Visible Region:\n");
fFullVisible.PrintToStream();
#endif
if(!IsHidden()) if(!IsHidden())
{ {
switch(action) switch(action)
{ {
case B_LAYER_NONE: case B_LAYER_NONE:
{ {
RBTRACE(("2) Layer(%s): Action B_LAYER_NONE\n", GetName()));
BRegion r(fVisible); BRegion r(fVisible);
if (oldRegion.CountRects() > 0) if (oldRegion.CountRects() > 0)
r.Exclude(&oldRegion); r.Exclude(&oldRegion);
@@ -984,6 +962,7 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
} }
case B_LAYER_MOVE: case B_LAYER_MOVE:
{ {
RBTRACE(("2) Layer(%s): Action B_LAYER_MOVE\n", GetName()));
BRegion redrawReg; BRegion redrawReg;
BRegion *copyReg = new BRegion(); BRegion *copyReg = new BRegion();
BRegion screenReg(fRootLayer->Bounds()); BRegion screenReg(fRootLayer->Bounds());
@@ -1016,6 +995,7 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
} }
case B_LAYER_RESIZE: case B_LAYER_RESIZE:
{ {
RBTRACE(("2) Layer(%s): Action B_LAYER_RESIZE\n", GetName()));
BRegion redrawReg; BRegion redrawReg;
redrawReg = fVisible; redrawReg = fVisible;
@@ -1027,6 +1007,7 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
} }
case B_LAYER_MASK_RESIZE: case B_LAYER_MASK_RESIZE:
{ {
RBTRACE(("2) Layer(%s): Action B_LAYER_MASK_RESIZE\n", GetName()));
BRegion redrawReg; BRegion redrawReg;
BRegion *copyReg = new BRegion(); BRegion *copyReg = new BRegion();
@@ -1053,6 +1034,7 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
} }
default: default:
{ {
RBTRACE(("2) Layer(%s): Action default\n", GetName()));
break; break;
} }
} }
@@ -1064,23 +1046,13 @@ void Layer::RebuildRegions( const BRegion& reg, uint32 action, BPoint pt, BPoint
} }
*/ */
#ifdef DEBUG_LAYER_REBUILD
printf("\n ======= Layer(%s)::RR finals ======\n", GetName());
oldRegion.PrintToStream();
fFull.PrintToStream();
fFullVisible.PrintToStream();
fVisible.PrintToStream();
printf("==========RedrawReg===========\n");
fRootLayer->fRedrawReg.PrintToStream();
printf("=====================\n");
#endif
STRACE(("Layer(%s)::RebuildRegions() END\n", GetName())); STRACE(("Layer(%s)::RebuildRegions() END\n", GetName()));
} }
void Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 action, BPoint& pt) void Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 action, BPoint& pt)
{ {
STRACE(("Layer(%s)::StartRebuildRegions() START\n", GetName())); STRACE(("Layer(%s)::StartRebuildRegions() START\n", GetName()));
RBTRACE(("\n\nLayer(%s)::StartRebuildRegions() START\n", GetName()));
if(!fParent) if(!fParent)
fFullVisible = fFull; fFullVisible = fFull;
@@ -1098,14 +1070,11 @@ void Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 actio
} }
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("\n ===!=== Layer(%s)::SRR finals ===!===\n", GetName()); printf("\nSRR: Layer(%s) ALMOST done regions:\n", GetName());
fFull.PrintToStream(); printf("\tVisible Region:\n");
fFullVisible.PrintToStream(); fVisible.PrintToStream();
fVisible.PrintToStream(); printf("\tFull Visible Region:\n");
oldVisible.PrintToStream(); fFullVisible.PrintToStream();
printf("=====!=====RedrawReg=====!=====\n");
fRootLayer->fRedrawReg.PrintToStream();
printf("=====================\n");
#endif #endif
BRegion redrawReg(fVisible); BRegion redrawReg(fVisible);
@@ -1118,19 +1087,20 @@ void Layer::StartRebuildRegions( const BRegion& reg, Layer *target, uint32 actio
fRootLayer->fRedrawReg.Include(&redrawReg); fRootLayer->fRedrawReg.Include(&redrawReg);
#ifdef DEBUG_LAYER_REBUILD #ifdef DEBUG_LAYER_REBUILD
printf("Layer(%s)::StartRebuildREgions() ended! Redraw Region:\n", GetName()); printf("\nLayer(%s)::StartRebuildRegions() DONE. Results:\n", GetName());
fRootLayer->fRedrawReg.PrintToStream(); printf("\tRedraw Region:\n");
printf("\n"); fRootLayer->fRedrawReg.PrintToStream();
printf("Layer(%s)::StartRebuildREgions() ended! Copy Region:\n", GetName()); printf("\tCopy Region:\n");
for(int32 k=0; k<fRootLayer->fCopyRegList.CountItems(); k++) for(int32 k=0; k<fRootLayer->fCopyRegList.CountItems(); k++)
{ {
((BRegion*)(fRootLayer->fCopyRegList.ItemAt(k)))->PrintToStream(); ((BRegion*)(fRootLayer->fCopyRegList.ItemAt(k)))->PrintToStream();
((BPoint*)(fRootLayer->fCopyList.ItemAt(k)))->PrintToStream(); ((BPoint*)(fRootLayer->fCopyList.ItemAt(k)))->PrintToStream();
} }
printf("\n"); printf("\n");
#endif #endif
STRACE(("Layer(%s)::StartRebuildRegions() END\n", GetName())); STRACE(("Layer(%s)::StartRebuildRegions() END\n", GetName()));
RBTRACE(("Layer(%s)::StartRebuildRegions() END\n", GetName()));
} }
//! Moves the layer by specified values, complete with redraw //! Moves the layer by specified values, complete with redraw