Implemented BPortLink::AttachShape and BPortLink::ReadShape and used them for passing the shapes in AS_GET_GLYPH_SHAPES.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12215 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2005-04-01 07:29:04 +00:00
parent ebf8af66c9
commit c2da902f2e
6 changed files with 42 additions and 45 deletions
+2 -26
View File
@@ -1163,32 +1163,8 @@ BFont::GetGlyphShapes(const char charArray[], int32 numChars, BShape *glyphShape
if(code!=SERVER_TRUE)
return;
// This is going to be dog slow, but it'll do for now
char *buffer=NULL;
size_t buffersize=0;
for(int32 i=0; i<numChars; i++)
{
size_t msgsize;
link.Read<size_t>(&msgsize);
if(msgsize>buffersize)
{
delete buffer;
buffer=new char[msgsize];
}
link.Read(buffer,msgsize);
BMessage shapemsg;
shapemsg.Unflatten(buffer);
BShape shape(&shapemsg);
glyphShapeArray[i]->Clear();
glyphShapeArray[i]->AddShape(&shape);
}
delete buffer;
for(int32 i = 0; i < numChars; i++)
link.ReadShape(glyphShapeArray[i]);
}