More work for integrating the new clipping code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13186 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
//
|
//
|
||||||
// File Name: Layer.cpp
|
// File Name: Layer.cpp
|
||||||
// Author: DarkWyrm <[email protected]>
|
// Author: DarkWyrm <[email protected]>
|
||||||
// Adi Oanca <adioanca@myrealbox.com>
|
// Adi Oanca <adioanca@cotty.iren.ro>
|
||||||
// Stephan Aßmus <[email protected]>
|
// Stephan Aßmus <[email protected]>
|
||||||
// Description: Class used for rendering to the frame buffer. One layer per
|
// Description: Class used for rendering to the frame buffer. One layer per
|
||||||
// view on screen and also for window decorators
|
// view on screen and also for window decorators
|
||||||
@@ -197,8 +197,9 @@ Layer::AddChild(Layer* layer, ServerWindow* serverWin)
|
|||||||
c->fServerWin=serverWin;
|
c->fServerWin=serverWin;
|
||||||
|
|
||||||
// 2.3) we are attached to the main tree so build our full region.
|
// 2.3) we are attached to the main tree so build our full region.
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
c->RebuildFullRegion();
|
c->RebuildFullRegion();
|
||||||
|
#endif
|
||||||
// tree parsing algorithm
|
// tree parsing algorithm
|
||||||
if (c->fTopChild) {
|
if (c->fTopChild) {
|
||||||
// go deep
|
// go deep
|
||||||
@@ -447,6 +448,7 @@ Layer::BottomChild() const
|
|||||||
return fCurrent;
|
return fCurrent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
|
|
||||||
//! Rebuilds the layer's "completely visible" region
|
//! Rebuilds the layer's "completely visible" region
|
||||||
void
|
void
|
||||||
@@ -836,6 +838,8 @@ Layer::ResizeOthers(float x, float y, BPoint coords[], BPoint *ptOffset)
|
|||||||
return 0UL;
|
return 0UL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// Redraw
|
// Redraw
|
||||||
void
|
void
|
||||||
Layer::Redraw(const BRegion& reg, Layer *startFrom)
|
Layer::Redraw(const BRegion& reg, Layer *startFrom)
|
||||||
@@ -898,7 +902,9 @@ Layer::Show(bool invalidate)
|
|||||||
|
|
||||||
// NOTE: I added this here and it solves the invalid region problem
|
// NOTE: I added this here and it solves the invalid region problem
|
||||||
// for Windows that have been resized before they were shown. -Stephan
|
// for Windows that have been resized before they were shown. -Stephan
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
RebuildFullRegion();
|
RebuildFullRegion();
|
||||||
|
#endif
|
||||||
SendViewCoordUpdateMsg();
|
SendViewCoordUpdateMsg();
|
||||||
|
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
@@ -1321,15 +1327,19 @@ Layer::move_layer(float x, float y)
|
|||||||
wb->fUpdateReg.OffsetBy(x, y);
|
wb->fUpdateReg.OffsetBy(x, y);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
BPoint pt(x, y);
|
BPoint pt(x, y);
|
||||||
BRect rect(fFull.Frame().OffsetByCopy(pt));
|
BRect rect(fFull.Frame().OffsetByCopy(pt));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!fParent) {
|
if (!fParent) {
|
||||||
printf("no parent in Layer::move_layer() (%s)\n", GetName());
|
printf("no parent in Layer::move_layer() (%s)\n", GetName());
|
||||||
fFrameAction = B_LAYER_ACTION_NONE;
|
fFrameAction = B_LAYER_ACTION_NONE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#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,
|
||||||
@@ -1351,7 +1361,10 @@ Layer::resize_layer(float x, float y)
|
|||||||
{
|
{
|
||||||
fFrameAction = B_LAYER_ACTION_RESIZE;
|
fFrameAction = B_LAYER_ACTION_RESIZE;
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
BPoint pt(x,y);
|
BPoint pt(x,y);
|
||||||
|
#endif
|
||||||
|
|
||||||
BRect rect(fFull.Frame());
|
BRect rect(fFull.Frame());
|
||||||
rect.right += x;
|
rect.right += x;
|
||||||
rect.bottom += y;
|
rect.bottom += y;
|
||||||
@@ -1361,9 +1374,10 @@ printf("no parent in Layer::resize_layer() (%s)\n", GetName());
|
|||||||
fFrameAction = B_LAYER_ACTION_NONE;
|
fFrameAction = B_LAYER_ACTION_NONE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#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);
|
||||||
fParent->Redraw(fRootLayer->fRedrawReg, this);
|
fParent->Redraw(fRootLayer->fRedrawReg, this);
|
||||||
|
|
||||||
@@ -1392,9 +1406,11 @@ Layer::FullInvalidate(const BRegion& region)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
BPoint pt(0,0);
|
BPoint pt(0,0);
|
||||||
StartRebuildRegions(region, NULL,/* B_LAYER_INVALIDATE, pt); */B_LAYER_NONE, pt);
|
StartRebuildRegions(region, NULL,/* B_LAYER_INVALIDATE, pt); */B_LAYER_NONE, pt);
|
||||||
|
#endif
|
||||||
|
|
||||||
Redraw(fRootLayer->fRedrawReg);
|
Redraw(fRootLayer->fRedrawReg);
|
||||||
|
|
||||||
EmptyGlobals();
|
EmptyGlobals();
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class Layer {
|
|||||||
|
|
||||||
const char* GetName() const
|
const char* GetName() const
|
||||||
{ return (fName) ? fName->String() : NULL; }
|
{ return (fName) ? fName->String() : NULL; }
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
virtual void RebuildFullRegion();
|
virtual void RebuildFullRegion();
|
||||||
void StartRebuildRegions(const BRegion& reg,
|
void StartRebuildRegions(const BRegion& reg,
|
||||||
Layer* target,
|
Layer* target,
|
||||||
@@ -109,7 +109,7 @@ class Layer {
|
|||||||
uint32 ResizeOthers(float x, float y,
|
uint32 ResizeOthers(float x, float y,
|
||||||
BPoint coords[],
|
BPoint coords[],
|
||||||
BPoint* ptOffset);
|
BPoint* ptOffset);
|
||||||
|
#endif
|
||||||
void Redraw(const BRegion& reg,
|
void Redraw(const BRegion& reg,
|
||||||
Layer* startFrom = NULL);
|
Layer* startFrom = NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,9 @@ RootLayer::WorkingThread(void *data)
|
|||||||
|
|
||||||
// first make sure we are actualy visible
|
// first make sure we are actualy visible
|
||||||
oneRootLayer->Lock();
|
oneRootLayer->Lock();
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
oneRootLayer->RebuildFullRegion();
|
oneRootLayer->RebuildFullRegion();
|
||||||
|
#endif
|
||||||
oneRootLayer->invalidate_layer(oneRootLayer, oneRootLayer->Bounds());
|
oneRootLayer->invalidate_layer(oneRootLayer, oneRootLayer->Bounds());
|
||||||
oneRootLayer->Unlock();
|
oneRootLayer->Unlock();
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
//
|
//
|
||||||
// File Name: ServerWindow.cpp
|
// File Name: ServerWindow.cpp
|
||||||
// Author: DarkWyrm <[email protected]>
|
// Author: DarkWyrm <[email protected]>
|
||||||
// Adi Oanca <adioanca@mymail.ro>
|
// Adi Oanca <adioanca@cotty.iren.ro>
|
||||||
// Stephan Aßmus <[email protected]>
|
// Stephan Aßmus <[email protected]>
|
||||||
// Description: Shadow BWindow class
|
// Description: Shadow BWindow class
|
||||||
//
|
//
|
||||||
@@ -519,7 +519,9 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
SetLayerState(fCurrentLayer, link);
|
SetLayerState(fCurrentLayer, link);
|
||||||
// TODO: should this be moved into SetLayerState?
|
// TODO: should this be moved into SetLayerState?
|
||||||
// If it _always_ needs to be done afterwards, then yes!
|
// If it _always_ needs to be done afterwards, then yes!
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
fCurrentLayer->RebuildFullRegion();
|
fCurrentLayer->RebuildFullRegion();
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_LAYER_SET_FONT_STATE:
|
case AS_LAYER_SET_FONT_STATE:
|
||||||
@@ -527,7 +529,9 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
DTRACE(("ServerWindow %s: Message AS_LAYER_SET_FONT_STATE: Layer name: %s\n", fName, fCurrentLayer->fName->String()));
|
DTRACE(("ServerWindow %s: Message AS_LAYER_SET_FONT_STATE: Layer name: %s\n", fName, fCurrentLayer->fName->String()));
|
||||||
// SetLayerFontState(fCurrentLayer);
|
// SetLayerFontState(fCurrentLayer);
|
||||||
SetLayerFontState(fCurrentLayer, link);
|
SetLayerFontState(fCurrentLayer, link);
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
fCurrentLayer->RebuildFullRegion();
|
fCurrentLayer->RebuildFullRegion();
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_LAYER_GET_STATE:
|
case AS_LAYER_GET_STATE:
|
||||||
@@ -699,8 +703,9 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
DTRACE(("ServerWindow %s: Message AS_LAYER_PUSH_STATE: Layer: %s\n",fName, fCurrentLayer->fName->String()));
|
DTRACE(("ServerWindow %s: Message AS_LAYER_PUSH_STATE: Layer: %s\n",fName, fCurrentLayer->fName->String()));
|
||||||
|
|
||||||
fCurrentLayer->PushState();
|
fCurrentLayer->PushState();
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
fCurrentLayer->RebuildFullRegion();
|
fCurrentLayer->RebuildFullRegion();
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_LAYER_POP_STATE:
|
case AS_LAYER_POP_STATE:
|
||||||
@@ -708,8 +713,9 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
DTRACE(("ServerWindow %s: Message AS_LAYER_POP_STATE: Layer: %s\n",fName, fCurrentLayer->fName->String()));
|
DTRACE(("ServerWindow %s: Message AS_LAYER_POP_STATE: Layer: %s\n",fName, fCurrentLayer->fName->String()));
|
||||||
|
|
||||||
fCurrentLayer->PopState();
|
fCurrentLayer->PopState();
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
fCurrentLayer->RebuildFullRegion();
|
fCurrentLayer->RebuildFullRegion();
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_LAYER_SET_SCALE:
|
case AS_LAYER_SET_SCALE:
|
||||||
@@ -893,7 +899,9 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
|
|
||||||
fCurrentLayer->fLayerData->SetClippingRegion(region);
|
fCurrentLayer->fLayerData->SetClippingRegion(region);
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
fCurrentLayer->RebuildFullRegion();
|
fCurrentLayer->RebuildFullRegion();
|
||||||
|
#endif
|
||||||
if (!(fCurrentLayer->IsHidden()))
|
if (!(fCurrentLayer->IsHidden()))
|
||||||
myRootLayer->GoInvalidate(fCurrentLayer, fCurrentLayer->fFull);
|
myRootLayer->GoInvalidate(fCurrentLayer, fCurrentLayer->fFull);
|
||||||
|
|
||||||
@@ -960,7 +968,9 @@ ServerWindow::DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
}
|
}
|
||||||
fCurrentLayer->fLayerData->SetClippingRegion(region);
|
fCurrentLayer->fLayerData->SetClippingRegion(region);
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
fCurrentLayer->RebuildFullRegion();
|
fCurrentLayer->RebuildFullRegion();
|
||||||
|
#endif
|
||||||
if (!(fCurrentLayer->IsHidden()))
|
if (!(fCurrentLayer->IsHidden()))
|
||||||
myRootLayer->GoInvalidate(fCurrentLayer, fCurrentLayer->fFull);
|
myRootLayer->GoInvalidate(fCurrentLayer, fCurrentLayer->fFull);
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,9 @@ WinBorder::WinBorder(const BRect &r,
|
|||||||
fDecorator->GetSizeLimits(&fMinWidth, &fMinHeight, &fMaxWidth, &fMaxHeight);
|
fDecorator->GetSizeLimits(&fMinWidth, &fMinHeight, &fMaxWidth, &fMaxHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
RebuildFullRegion();
|
RebuildFullRegion();
|
||||||
|
#endif
|
||||||
|
|
||||||
gDesktop->AddWinBorder(this);
|
gDesktop->AddWinBorder(this);
|
||||||
|
|
||||||
@@ -283,6 +285,8 @@ y = (float)int32(y);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
|
|
||||||
//! Rebuilds the WinBorder's "fully-visible" region based on info from the decorator
|
//! Rebuilds the WinBorder's "fully-visible" region based on info from the decorator
|
||||||
void
|
void
|
||||||
WinBorder::RebuildFullRegion()
|
WinBorder::RebuildFullRegion()
|
||||||
@@ -296,6 +300,8 @@ WinBorder::RebuildFullRegion()
|
|||||||
fDecorator->GetFootprint(&fFull);
|
fDecorator->GetFootprint(&fFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//! Sets the minimum and maximum sizes of the window
|
//! Sets the minimum and maximum sizes of the window
|
||||||
void
|
void
|
||||||
WinBorder::SetSizeLimits(float minWidth, float maxWidth,
|
WinBorder::SetSizeLimits(float minWidth, float maxWidth,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
//
|
//
|
||||||
// File Name: WinBorder.h
|
// File Name: WinBorder.h
|
||||||
// Author: DarkWyrm <[email protected]>
|
// Author: DarkWyrm <[email protected]>
|
||||||
// Adi Oanca <adioanca@mymail.ro>
|
// Adi Oanca <adioanca@cotty.iren.ro>
|
||||||
// Stephan Aßmus <[email protected]>
|
// Stephan Aßmus <[email protected]>
|
||||||
// Description: Layer subclass which handles window management
|
// Description: Layer subclass which handles window management
|
||||||
//
|
//
|
||||||
@@ -83,9 +83,9 @@ class WinBorder : public Layer {
|
|||||||
|
|
||||||
virtual void MoveBy(float x, float y);
|
virtual void MoveBy(float x, float y);
|
||||||
virtual void ResizeBy(float x, float y);
|
virtual void ResizeBy(float x, float y);
|
||||||
|
#ifndef NEW_CLIPPING
|
||||||
virtual void RebuildFullRegion();
|
virtual void RebuildFullRegion();
|
||||||
|
#endif
|
||||||
void SetSizeLimits(float minWidth,
|
void SetSizeLimits(float minWidth,
|
||||||
float maxWidth,
|
float maxWidth,
|
||||||
float minHeight,
|
float minHeight,
|
||||||
|
|||||||
Reference in New Issue
Block a user