Now draws something again, it's just not updated on changes yet.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15448 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-12-09 15:39:20 +00:00
parent e566030298
commit a7e201435f
2 changed files with 15 additions and 13 deletions
+13 -12
View File
@@ -171,7 +171,8 @@ WorkspacesLayer::_DrawWindow(DrawingEngine* drawingEngine, const BRect& workspac
void void
WorkspacesLayer::_DrawWorkspace(DrawingEngine* drawingEngine, int32 index) WorkspacesLayer::_DrawWorkspace(DrawingEngine* drawingEngine,
BRegion& redraw, int32 index)
{ {
BRect rect = _WorkspaceAt(index); BRect rect = _WorkspaceAt(index);
@@ -191,7 +192,7 @@ WorkspacesLayer::_DrawWorkspace(DrawingEngine* drawingEngine, int32 index)
// draw windows // draw windows
BRegion backgroundRegion = fLocalClipping; BRegion backgroundRegion = redraw;
// ToDo: would be nice to get the real update region here // ToDo: would be nice to get the real update region here
@@ -218,9 +219,7 @@ WorkspacesLayer::_DrawWorkspace(DrawingEngine* drawingEngine, int32 index)
drawingEngine->ConstrainClippingRegion(&backgroundRegion); drawingEngine->ConstrainClippingRegion(&backgroundRegion);
drawingEngine->FillRect(rect, color); drawingEngine->FillRect(rect, color);
// TODO: ConstrainClippingRegion() should accept a const parameter !! drawingEngine->ConstrainClippingRegion(&redraw);
BRegion cRegion(fLocalClipping);
drawingEngine->ConstrainClippingRegion(&cRegion);
} }
@@ -235,6 +234,11 @@ void
WorkspacesLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping, WorkspacesLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
BRegion* windowContentClipping, bool deep) BRegion* windowContentClipping, bool deep)
{ {
// we can only draw within our own area
BRegion redraw(ScreenClipping(windowContentClipping));
// add the current clipping
redraw.IntersectWith(effectiveClipping);
int32 columns, rows; int32 columns, rows;
_GetGrid(columns, rows); _GetGrid(columns, rows);
@@ -243,14 +247,12 @@ WorkspacesLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
// make sure the grid around the active workspace is not drawn // make sure the grid around the active workspace is not drawn
// to reduce flicker // to reduce flicker
BRect activeRect = _WorkspaceAt(Window()->Desktop()->CurrentWorkspace()); BRect activeRect = _WorkspaceAt(Window()->Desktop()->CurrentWorkspace());
BRegion gridRegion(fLocalClipping); BRegion gridRegion(redraw);
gridRegion.Exclude(activeRect); gridRegion.Exclude(activeRect);
drawingEngine->ConstrainClippingRegion(&gridRegion); drawingEngine->ConstrainClippingRegion(&gridRegion);
BRect frame = Frame(); BRect frame = Frame();
BPoint pt(0,0); // top ViewLayer frame is in screen coordinates
ConvertToScreen(&pt);
frame.OffsetBy(pt);
// horizontal lines // horizontal lines
@@ -274,13 +276,12 @@ WorkspacesLayer::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
BPoint(rect.right, frame.bottom), ViewColor()); BPoint(rect.right, frame.bottom), ViewColor());
} }
BRegion cRegion(fLocalClipping); drawingEngine->ConstrainClippingRegion(&redraw);
drawingEngine->ConstrainClippingRegion(&cRegion);
// draw workspaces // draw workspaces
for (int32 i = rows * columns; i-- > 0;) { for (int32 i = rows * columns; i-- > 0;) {
_DrawWorkspace(drawingEngine, i); _DrawWorkspace(drawingEngine, redraw, i);
} }
} }
+2 -1
View File
@@ -37,7 +37,8 @@ class WorkspacesLayer : public ViewLayer {
const BRect& screenFrame, WindowLayer* window, const BRect& screenFrame, WindowLayer* window,
BPoint windowPosition, BRegion& backgroundRegion, BPoint windowPosition, BRegion& backgroundRegion,
bool active); bool active);
void _DrawWorkspace(DrawingEngine* drawingEngine, int32 index); void _DrawWorkspace(DrawingEngine* drawingEngine, BRegion& redraw,
int32 index);
void _DarkenColor(RGBColor& color) const; void _DarkenColor(RGBColor& color) const;
}; };