* removed no longer valid TODOs
* cleanup the code in a few places * fixed a bug where the border region would not be made empty if there was a decorator previously, but there is no new one * slight improvement for memory footprint of WindowLayer by using bit fields for more of the flags git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23271 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -474,9 +474,9 @@ DefaultDecorator::GetFootprint(BRegion *region)
|
|||||||
if (fLook == B_NO_BORDER_WINDOW_LOOK)
|
if (fLook == B_NO_BORDER_WINDOW_LOOK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
region->Include(fTopBorder);
|
||||||
region->Include(fLeftBorder);
|
region->Include(fLeftBorder);
|
||||||
region->Include(fRightBorder);
|
region->Include(fRightBorder);
|
||||||
region->Include(fTopBorder);
|
|
||||||
region->Include(fBottomBorder);
|
region->Include(fBottomBorder);
|
||||||
|
|
||||||
if (fLook == B_BORDERED_WINDOW_LOOK)
|
if (fLook == B_BORDERED_WINDOW_LOOK)
|
||||||
|
|||||||
@@ -76,15 +76,16 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
|
|||||||
|
|
||||||
fVisibleRegion(),
|
fVisibleRegion(),
|
||||||
fVisibleContentRegion(),
|
fVisibleContentRegion(),
|
||||||
fVisibleContentRegionValid(false),
|
|
||||||
fDirtyRegion(),
|
fDirtyRegion(),
|
||||||
fDirtyCause(0),
|
fDirtyCause(0),
|
||||||
|
|
||||||
fBorderRegion(),
|
fBorderRegion(),
|
||||||
fBorderRegionValid(false),
|
|
||||||
fContentRegion(),
|
fContentRegion(),
|
||||||
fContentRegionValid(false),
|
|
||||||
fEffectiveDrawingRegion(),
|
fEffectiveDrawingRegion(),
|
||||||
|
|
||||||
|
fVisibleContentRegionValid(false),
|
||||||
|
fBorderRegionValid(false),
|
||||||
|
fContentRegionValid(false),
|
||||||
fEffectiveDrawingRegionValid(false),
|
fEffectiveDrawingRegionValid(false),
|
||||||
|
|
||||||
fRegionPool(),
|
fRegionPool(),
|
||||||
@@ -203,11 +204,9 @@ WindowLayer::GetFullRegion(BRegion* region)
|
|||||||
// TODO: if someone needs to call this from
|
// TODO: if someone needs to call this from
|
||||||
// the outside, the clipping needs to be readlocked!
|
// the outside, the clipping needs to be readlocked!
|
||||||
|
|
||||||
|
// start from the decorator border, extend to use the frame
|
||||||
GetBorderRegion(region);
|
GetBorderRegion(region);
|
||||||
|
|
||||||
// start from the frame, extend to include decorator border
|
|
||||||
region->Include(fFrame);
|
region->Include(fFrame);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBorderRegion
|
// GetBorderRegion
|
||||||
@@ -218,25 +217,11 @@ WindowLayer::GetBorderRegion(BRegion* region)
|
|||||||
// the outside, the clipping needs to be readlocked!
|
// the outside, the clipping needs to be readlocked!
|
||||||
|
|
||||||
if (!fBorderRegionValid) {
|
if (!fBorderRegionValid) {
|
||||||
// TODO: checkup Decorator::GetFootPrint() to see if it is as fast as this:
|
if (fDecorator)
|
||||||
/* fBorderRegion.Set(BRect(fFrame.left - 4, fFrame.top - 20,
|
|
||||||
(fFrame.left + fFrame.right) / 2, fFrame.top - 5));
|
|
||||||
fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.top - 4,
|
|
||||||
fFrame.right + 4, fFrame.top - 1));
|
|
||||||
fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.top,
|
|
||||||
fFrame.left - 1, fFrame.bottom));
|
|
||||||
fBorderRegion.Include(BRect(fFrame.right + 1, fFrame.top,
|
|
||||||
fFrame.right + 4, fFrame.bottom - 11));
|
|
||||||
fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.bottom + 1,
|
|
||||||
fFrame.right - 11, fFrame.bottom + 4));
|
|
||||||
fBorderRegion.Include(BRect(fFrame.right - 10, fFrame.bottom - 10,
|
|
||||||
fFrame.right + 4, fFrame.bottom + 4));*/
|
|
||||||
|
|
||||||
// TODO: remove and use Decorator::GetFootPrint()
|
|
||||||
// start from the frame, extend to include decorator border
|
|
||||||
if (fDecorator) {
|
|
||||||
fDecorator->GetFootprint(&fBorderRegion);
|
fDecorator->GetFootprint(&fBorderRegion);
|
||||||
}
|
else
|
||||||
|
fBorderRegion.MakeEmpty();
|
||||||
|
|
||||||
fBorderRegionValid = true;
|
fBorderRegionValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -250,7 +250,6 @@ class WindowLayer {
|
|||||||
|
|
||||||
BRegion fVisibleRegion;
|
BRegion fVisibleRegion;
|
||||||
BRegion fVisibleContentRegion;
|
BRegion fVisibleContentRegion;
|
||||||
bool fVisibleContentRegionValid;
|
|
||||||
// our part of the "global" dirty region
|
// our part of the "global" dirty region
|
||||||
// it is calculated from the desktop thread,
|
// it is calculated from the desktop thread,
|
||||||
// but we can write to it when we read locked
|
// but we can write to it when we read locked
|
||||||
@@ -261,24 +260,26 @@ class WindowLayer {
|
|||||||
|
|
||||||
// caching local regions
|
// caching local regions
|
||||||
BRegion fBorderRegion;
|
BRegion fBorderRegion;
|
||||||
bool fBorderRegionValid;
|
|
||||||
BRegion fContentRegion;
|
BRegion fContentRegion;
|
||||||
bool fContentRegionValid;
|
|
||||||
BRegion fEffectiveDrawingRegion;
|
BRegion fEffectiveDrawingRegion;
|
||||||
bool fEffectiveDrawingRegionValid;
|
|
||||||
|
bool fVisibleContentRegionValid : 1;
|
||||||
|
bool fBorderRegionValid : 1;
|
||||||
|
bool fContentRegionValid : 1;
|
||||||
|
bool fEffectiveDrawingRegionValid : 1;
|
||||||
|
|
||||||
::RegionPool fRegionPool;
|
::RegionPool fRegionPool;
|
||||||
|
|
||||||
BObjectList<WindowLayer> fSubsets;
|
BObjectList<WindowLayer> fSubsets;
|
||||||
|
|
||||||
// TODO: remove those some day (let the decorator handle that stuff)
|
// TODO: remove those some day (let the decorator handle that stuff)
|
||||||
bool fIsClosing;
|
bool fIsClosing : 1;
|
||||||
bool fIsMinimizing;
|
bool fIsMinimizing : 1;
|
||||||
bool fIsZooming;
|
bool fIsZooming : 1;
|
||||||
bool fIsResizing;
|
bool fIsResizing : 1;
|
||||||
bool fIsSlidingTab;
|
bool fIsSlidingTab : 1;
|
||||||
bool fIsDragging;
|
bool fIsDragging : 1;
|
||||||
bool fActivateOnMouseUp;
|
bool fActivateOnMouseUp : 1;
|
||||||
|
|
||||||
::Decorator* fDecorator;
|
::Decorator* fDecorator;
|
||||||
ViewLayer* fTopLayer;
|
ViewLayer* fTopLayer;
|
||||||
|
|||||||
Reference in New Issue
Block a user