* 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:
parent
92c779bd11
commit
c177064158
@ -474,9 +474,9 @@ DefaultDecorator::GetFootprint(BRegion *region)
|
||||
if (fLook == B_NO_BORDER_WINDOW_LOOK)
|
||||
return;
|
||||
|
||||
region->Include(fTopBorder);
|
||||
region->Include(fLeftBorder);
|
||||
region->Include(fRightBorder);
|
||||
region->Include(fTopBorder);
|
||||
region->Include(fBottomBorder);
|
||||
|
||||
if (fLook == B_BORDERED_WINDOW_LOOK)
|
||||
|
@ -76,15 +76,16 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
|
||||
|
||||
fVisibleRegion(),
|
||||
fVisibleContentRegion(),
|
||||
fVisibleContentRegionValid(false),
|
||||
fDirtyRegion(),
|
||||
fDirtyCause(0),
|
||||
|
||||
fBorderRegion(),
|
||||
fBorderRegionValid(false),
|
||||
fContentRegion(),
|
||||
fContentRegionValid(false),
|
||||
fEffectiveDrawingRegion(),
|
||||
|
||||
fVisibleContentRegionValid(false),
|
||||
fBorderRegionValid(false),
|
||||
fContentRegionValid(false),
|
||||
fEffectiveDrawingRegionValid(false),
|
||||
|
||||
fRegionPool(),
|
||||
@ -203,11 +204,9 @@ WindowLayer::GetFullRegion(BRegion* region)
|
||||
// TODO: if someone needs to call this from
|
||||
// the outside, the clipping needs to be readlocked!
|
||||
|
||||
// start from the decorator border, extend to use the frame
|
||||
GetBorderRegion(region);
|
||||
|
||||
// start from the frame, extend to include decorator border
|
||||
region->Include(fFrame);
|
||||
|
||||
}
|
||||
|
||||
// GetBorderRegion
|
||||
@ -218,25 +217,11 @@ WindowLayer::GetBorderRegion(BRegion* region)
|
||||
// the outside, the clipping needs to be readlocked!
|
||||
|
||||
if (!fBorderRegionValid) {
|
||||
// TODO: checkup Decorator::GetFootPrint() to see if it is as fast as this:
|
||||
/* 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) {
|
||||
if (fDecorator)
|
||||
fDecorator->GetFootprint(&fBorderRegion);
|
||||
}
|
||||
else
|
||||
fBorderRegion.MakeEmpty();
|
||||
|
||||
fBorderRegionValid = true;
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,6 @@ class WindowLayer {
|
||||
|
||||
BRegion fVisibleRegion;
|
||||
BRegion fVisibleContentRegion;
|
||||
bool fVisibleContentRegionValid;
|
||||
// our part of the "global" dirty region
|
||||
// it is calculated from the desktop thread,
|
||||
// but we can write to it when we read locked
|
||||
@ -261,24 +260,26 @@ class WindowLayer {
|
||||
|
||||
// caching local regions
|
||||
BRegion fBorderRegion;
|
||||
bool fBorderRegionValid;
|
||||
BRegion fContentRegion;
|
||||
bool fContentRegionValid;
|
||||
BRegion fEffectiveDrawingRegion;
|
||||
bool fEffectiveDrawingRegionValid;
|
||||
|
||||
bool fVisibleContentRegionValid : 1;
|
||||
bool fBorderRegionValid : 1;
|
||||
bool fContentRegionValid : 1;
|
||||
bool fEffectiveDrawingRegionValid : 1;
|
||||
|
||||
::RegionPool fRegionPool;
|
||||
|
||||
BObjectList<WindowLayer> fSubsets;
|
||||
|
||||
// TODO: remove those some day (let the decorator handle that stuff)
|
||||
bool fIsClosing;
|
||||
bool fIsMinimizing;
|
||||
bool fIsZooming;
|
||||
bool fIsResizing;
|
||||
bool fIsSlidingTab;
|
||||
bool fIsDragging;
|
||||
bool fActivateOnMouseUp;
|
||||
bool fIsClosing : 1;
|
||||
bool fIsMinimizing : 1;
|
||||
bool fIsZooming : 1;
|
||||
bool fIsResizing : 1;
|
||||
bool fIsSlidingTab : 1;
|
||||
bool fIsDragging : 1;
|
||||
bool fActivateOnMouseUp : 1;
|
||||
|
||||
::Decorator* fDecorator;
|
||||
ViewLayer* fTopLayer;
|
||||
|
Loading…
Reference in New Issue
Block a user