Add support for the screen offset and scale to remote shape drawing. This brings

back scrollbar icons and menu markers for example after they got broken when
the offset was introduced.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40019 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2010-12-29 08:19:59 +00:00
parent f95b5003de
commit 49e57f098a
2 changed files with 18 additions and 5 deletions

View File

@ -1007,8 +1007,16 @@ RemoteView::_DrawThread()
archive.AddPoint("pts", point);
}
// the shape is in absolute coordinates
offscreen->MovePenTo(0, 0);
BPoint offset;
message.Read(offset);
float scale;
if (message.Read(scale) != B_OK)
continue;
offscreen->PushState();
offscreen->MovePenTo(offset);
offscreen->SetScale(scale);
BShape shape(&archive);
if (code == RP_STROKE_SHAPE) {
@ -1018,13 +1026,16 @@ RemoteView::_DrawThread()
offscreen->FillShape(&shape, pattern);
else {
BGradient *gradient;
if (message.ReadGradient(&gradient) != B_OK)
if (message.ReadGradient(&gradient) != B_OK) {
offscreen->PopState();
continue;
}
offscreen->FillShape(&shape, *gradient);
delete gradient;
}
offscreen->PopState();
invalidRegion.Include(bounds);
break;
}

View File

@ -721,7 +721,8 @@ RemoteDrawingEngine::DrawShape(const BRect& bounds, int32 opCount,
message.AddList(opList, opCount);
message.Add(pointCount);
message.AddList(pointList, pointCount);
// TODO: viewToScreenOffset and viewScale
message.Add(viewToScreenOffset);
message.Add(viewScale);
}
@ -743,7 +744,8 @@ RemoteDrawingEngine::FillShape(const BRect& bounds, int32 opCount,
message.Add(pointCount);
message.AddList(pointList, pointCount);
message.AddGradient(gradient);
// TODO: viewToScreenOffset and viewScale
message.Add(viewToScreenOffset);
message.Add(viewScale);
}