Another use of clipping regions to eliminate flickering. Maybe I have to come

up with something better though, when the window titles are drawn as well...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15259 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-12-01 10:41:01 +00:00
parent 19d801a6b6
commit a1d0e588b9
+12 -3
View File
@@ -205,19 +205,25 @@ WorkspacesLayer::_DarkenColor(RGBColor& color) const
void
WorkspacesLayer::Draw(const BRect& updateRect)
{
// ToDo: either draw into an off-screen bitmap, or turn off flickering...
int32 columns, rows;
_GetGrid(columns, rows);
// draw grid
// horizontal lines
// make sure the grid around the active workspace is not drawn
// to reduce flicker
BRect activeRect = _WorkspaceAt(Window()->Desktop()->CurrentWorkspace());
BRegion gridRegion(VisibleRegion());
gridRegion.Exclude(activeRect);
GetDrawingEngine()->ConstrainClippingRegion(&gridRegion);
BRect frame = Frame();
BPoint pt(0,0);
ConvertToScreen(&pt);
frame.OffsetBy(pt);
// horizontal lines
GetDrawingEngine()->StrokeLine(BPoint(frame.left, frame.top),
BPoint(frame.right, frame.top), ViewColor());
@@ -238,6 +244,9 @@ WorkspacesLayer::Draw(const BRect& updateRect)
BPoint(rect.right, frame.bottom), ViewColor());
}
BRegion cRegion(VisibleRegion());
GetDrawingEngine()->ConstrainClippingRegion(&cRegion);
// draw workspaces
for (int32 i = rows * columns; i-- > 0;) {