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:
@@ -205,19 +205,25 @@ WorkspacesLayer::_DarkenColor(RGBColor& color) const
|
|||||||
void
|
void
|
||||||
WorkspacesLayer::Draw(const BRect& updateRect)
|
WorkspacesLayer::Draw(const BRect& updateRect)
|
||||||
{
|
{
|
||||||
// ToDo: either draw into an off-screen bitmap, or turn off flickering...
|
|
||||||
|
|
||||||
int32 columns, rows;
|
int32 columns, rows;
|
||||||
_GetGrid(columns, rows);
|
_GetGrid(columns, rows);
|
||||||
|
|
||||||
// draw grid
|
// 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();
|
BRect frame = Frame();
|
||||||
BPoint pt(0,0);
|
BPoint pt(0,0);
|
||||||
ConvertToScreen(&pt);
|
ConvertToScreen(&pt);
|
||||||
frame.OffsetBy(pt);
|
frame.OffsetBy(pt);
|
||||||
|
|
||||||
|
// horizontal lines
|
||||||
|
|
||||||
GetDrawingEngine()->StrokeLine(BPoint(frame.left, frame.top),
|
GetDrawingEngine()->StrokeLine(BPoint(frame.left, frame.top),
|
||||||
BPoint(frame.right, frame.top), ViewColor());
|
BPoint(frame.right, frame.top), ViewColor());
|
||||||
|
|
||||||
@@ -238,6 +244,9 @@ WorkspacesLayer::Draw(const BRect& updateRect)
|
|||||||
BPoint(rect.right, frame.bottom), ViewColor());
|
BPoint(rect.right, frame.bottom), ViewColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BRegion cRegion(VisibleRegion());
|
||||||
|
GetDrawingEngine()->ConstrainClippingRegion(&cRegion);
|
||||||
|
|
||||||
// draw workspaces
|
// draw workspaces
|
||||||
|
|
||||||
for (int32 i = rows * columns; i-- > 0;) {
|
for (int32 i = rows * columns; i-- > 0;) {
|
||||||
|
|||||||
Reference in New Issue
Block a user