Lcd request early check in SkFontHost_FreeType::onFilterRec.
If the user didn't request lcd, don't spend any time checking if the
FT_Library supports it.
Review URL: https://codereview.chromium.org/864903002
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index 167c38b..ce762d8 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -697,11 +697,11 @@
rec->fTextSize = SkIntToScalar(1 << 14);
}
- {
+ if (isLCD(*rec)) {
// 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)) {
+ if (!gFTLibrary->isLCDSupported()) {
// If the runtime Freetype library doesn't support LCD, disable it here.
rec->fMaskFormat = SkMask::kA8_Format;
}