Index: src/ports/SkFontHost_FreeType.cpp |
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp |
index 459abbc9b800fe53a567ab910fe4eabb76c3abc1..167c38b6670e81878bfcef6e2b67855306b7716e 100644 |
--- a/src/ports/SkFontHost_FreeType.cpp |
+++ b/src/ports/SkFontHost_FreeType.cpp |
@@ -697,11 +697,15 @@ void SkTypeface_FreeType::onFilterRec(SkScalerContextRec* rec) const { |
rec->fTextSize = SkIntToScalar(1 << 14); |
} |
- AutoFTAccess fta(this); |
- if (!gFTLibrary->isLCDSupported() && isLCD(*rec)) { |
- // If the runtime Freetype library doesn't support LCD mode, we disable |
- // it here. |
- rec->fMaskFormat = SkMask::kA8_Format; |
+ { |
+ // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr. |
+ SkAutoMutexAcquire ama(gFTMutex); |
+ ref_ft_library(); |
+ if (!gFTLibrary->isLCDSupported() && isLCD(*rec)) { |
reed1
2015/01/21 19:29:34
maybe move the isLCD() check outside of the mutex-
|
+ // If the runtime Freetype library doesn't support LCD, disable it here. |
+ rec->fMaskFormat = SkMask::kA8_Format; |
+ } |
+ unref_ft_library(); |
} |
SkPaint::Hinting h = rec->getHinting(); |