Implemented SetPattern op. Reduced the buffer size to 4096 again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21937 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2007-08-14 06:39:37 +00:00
parent d23c482278
commit 37033892c5
4 changed files with 26 additions and 13 deletions

View File

@ -31,6 +31,7 @@ public:
status_t WriteSetPenSize(const float &penSize);
status_t WriteSetLineMode(const cap_mode &cap, const join_mode &join, const float &miterLimit);
status_t WriteSetScale(const float &scale);
status_t WriteSetPattern(const pattern &pat);
status_t WritePushState();
status_t WritePopState();

View File

@ -146,6 +146,20 @@ PictureDataWriter::WriteSetScale(const float &scale)
}
status_t
PictureDataWriter::WriteSetPattern(const pattern &pat)
{
try {
BeginOp(B_PIC_SET_STIPLE_PATTERN);
Write<pattern>(pat);
EndOp();
} catch (status_t &status) {
return status;
}
return B_OK;
}
status_t
PictureDataWriter::WriteSetHighColor(const rgb_color &color)
{

View File

@ -777,8 +777,8 @@ ServerPicture::~ServerPicture()
delete fData;
gTokenSpace.RemoveToken(fToken);
// We don't delete the subpictures themselves, the ServerApp keeps
// them in a list and will delete them on quit.
// We only delete the subpictures list, not the subpictures themselves,
// since the ServerApp keeps them in a list and will delete them on quit.
delete fPictures;
}
@ -795,19 +795,9 @@ ServerPicture::SyncState(ViewLayer *view)
WriteSetScale(view->CurrentState()->Scale());
WriteSetLineMode(view->CurrentState()->LineCapMode(), view->CurrentState()->LineJoinMode(),
view->CurrentState()->MiterLimit());
/*
BeginOp(B_PIC_SET_STIPLE_PATTERN);
AddData(view->CurrentState()->GetPattern().GetInt8(), sizeof(pattern));
EndOp();
*/
//WriteSetPattern(*view->CurrentState()->GetPattern().GetInt8());
WriteSetDrawingMode(view->CurrentState()->GetDrawingMode());
/*BeginOp(B_PIC_SET_BLENDING_MODE);
AddInt16((int16)view->CurrentState()->AlphaSrcMode());
AddInt16((int16)view->CurrentState()->AlphaFncMode());
EndOp();
*/
WriteSetHighColor(view->CurrentState()->HighColor().GetColor32());
WriteSetLowColor(view->CurrentState()->LowColor().GetColor32());

View File

@ -2437,6 +2437,14 @@ ServerWindow::_DispatchPictureMessage(int32 code, BPrivate::LinkReceiver &link)
break;
}
case AS_LAYER_SET_PATTERN:
{
pattern pat;
link.Read(&pat, sizeof(pattern));
picture->WriteSetPattern(pat);
break;
}
case AS_FILL_RECT:
case AS_STROKE_RECT:
{