Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1044)

Unified Diff: src/ports/SkFontHost_FreeType.cpp

Issue 835583003: Reduce overhead of SkFontHost_FreeType::onFilterRec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698