To solve creations with multi-threaded creation of text, added mutex to Font, and use of this mutex in Text, and added mutex to the reading
of fonts.
This commit is contained in:
@@ -448,6 +448,7 @@ String::iterator Text::computeLastCharacterOnLine(osg::Vec2& cursor, String::ite
|
||||
return lastChar;
|
||||
}
|
||||
|
||||
|
||||
void Text::computeGlyphRepresentation()
|
||||
{
|
||||
Font* activefont = getActiveFont();
|
||||
@@ -462,6 +463,8 @@ void Text::computeGlyphRepresentation()
|
||||
computePositions(); //to reset the origin
|
||||
return;
|
||||
}
|
||||
|
||||
OpenThreads::ScopedLock<Font::FontMutex> lock(activefont->getSerializeFontCallsMutex());
|
||||
|
||||
// initialize bounding box, it will be expanded during glyph position calculation
|
||||
_textBB.init();
|
||||
|
||||
Reference in New Issue
Block a user