Cleaned up code

This commit is contained in:
Robert Osfield 2018-09-11 09:03:01 +01:00
parent 22e6f6038f
commit 8780347f2f

View File

@ -328,7 +328,6 @@ Glyph* Font::getGlyph(const FontResolution& fontRes, unsigned int charcode)
FontResolution fontResUsed(0,0); FontResolution fontResUsed(0,0);
if (_implementation->supportsMultipleFontResolutions()) fontResUsed = fontRes; if (_implementation->supportsMultipleFontResolutions()) fontResUsed = fontRes;
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_glyphMapMutex); OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_glyphMapMutex);
FontSizeGlyphMap::iterator itr = _sizeGlyphMap.find(fontResUsed); FontSizeGlyphMap::iterator itr = _sizeGlyphMap.find(fontResUsed);
if (itr!=_sizeGlyphMap.end()) if (itr!=_sizeGlyphMap.end())
@ -341,13 +340,11 @@ Glyph* Font::getGlyph(const FontResolution& fontRes, unsigned int charcode)
Glyph* glyph = _implementation->getGlyph(fontResUsed, charcode); Glyph* glyph = _implementation->getGlyph(fontResUsed, charcode);
if (glyph) if (glyph)
{ {
//addGlyph(fontResUsed, charcode, glyph);
_sizeGlyphMap[fontResUsed][charcode] = glyph; _sizeGlyphMap[fontResUsed][charcode] = glyph;
return glyph; return glyph;
} }
else return 0; else return 0;
} }
}
Glyph3D* Font::getGlyph3D(const FontResolution &fontRes, unsigned int charcode) Glyph3D* Font::getGlyph3D(const FontResolution &fontRes, unsigned int charcode)
{ {
@ -356,7 +353,6 @@ Glyph3D* Font::getGlyph3D(const FontResolution &fontRes, unsigned int charcode)
FontResolution fontResUsed(0,0); FontResolution fontResUsed(0,0);
if (_implementation->supportsMultipleFontResolutions()) fontResUsed = fontRes; if (_implementation->supportsMultipleFontResolutions()) fontResUsed = fontRes;
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_glyphMapMutex); OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_glyphMapMutex);
FontSizeGlyph3DMap::iterator itr = _sizeGlyph3DMap.find(fontResUsed); FontSizeGlyph3DMap::iterator itr = _sizeGlyph3DMap.find(fontResUsed);
if (itr!=_sizeGlyph3DMap.end()) if (itr!=_sizeGlyph3DMap.end())
@ -374,7 +370,6 @@ Glyph3D* Font::getGlyph3D(const FontResolution &fontRes, unsigned int charcode)
} }
else return 0; else return 0;
} }
}
void Font::setThreadSafeRefUnref(bool threadSafe) void Font::setThreadSafeRefUnref(bool threadSafe)
{ {