Reviewers: reed1,
Message:
This went in with
https://codereview.chromium.org/1163833003 .
Interestingly, this should no longer be needed with FreeType 2.6.0+.
Description:
Need to hold the FT library mutex to use the library.
BUG=skia:1873
Please review this at
https://codereview.chromium.org/100063002/
Base URL:
http://skia.googlecode.com/svn/trunk/
Affected files (+2, -0 lines):
M src/ports/SkFontHost_FreeType.cpp
Index: src/ports/SkFontHost_FreeType.cpp
===================================================================
--- src/ports/SkFontHost_FreeType.cpp (revision 12431)
+++ src/ports/SkFontHost_FreeType.cpp (working copy)
@@ -961,10 +961,12 @@
}
uint16_t SkScalerContext_FreeType::generateCharToGlyph(SkUnichar uni) {
+ SkAutoMutexAcquire ac(gFTMutex);
return SkToU16(FT_Get_Char_Index( fFace, uni ));
}
SkUnichar SkScalerContext_FreeType::generateGlyphToChar(uint16_t glyph) {
+ SkAutoMutexAcquire ac(gFTMutex);
// iterate through each cmap entry, looking for matching glyph indices
FT_UInt glyphIndex;
SkUnichar charCode = FT_Get_First_Char( fFace, &glyphIndex );