Index: src/ports/SkFontHost_FreeType.cpp |
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp |
index 32eafad87c903098a02f179ee7f200428fd2d018..e8b72b5e090f3e3560ba6b6231bff34d55f87667 100644 |
--- a/src/ports/SkFontHost_FreeType.cpp |
+++ b/src/ports/SkFontHost_FreeType.cpp |
@@ -949,6 +949,7 @@ SkScalerContext_FreeType::~SkScalerContext_FreeType() { |
this face with other context (at different sizes). |
*/ |
FT_Error SkScalerContext_FreeType::setupSize() { |
herb_g
2015/11/03 19:09:28
Maybe change the name to indicate that this routin
|
+ gFTMutex.assertHeld(); |
FT_Error err = FT_Activate_Size(fFTSize); |
if (err != 0) { |
SkDEBUGF(("SkScalerContext_FreeType::FT_Activate_Size(%s %s, 0x%x, 0x%x) returned 0x%x\n", |
@@ -968,10 +969,12 @@ unsigned SkScalerContext_FreeType::generateGlyphCount() { |
} |
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 ); |