diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp index 20bd073532..84fd11b1f3 100644 --- a/src/ports/SkFontConfigInterface_direct.cpp +++ b/src/ports/SkFontConfigInterface_direct.cpp @@ -510,7 +510,8 @@ const char* kFontFormatCFF = "CFF"; SkFontConfigInterfaceDirect::SkFontConfigInterfaceDirect() { FCLocker lock; - fcConfig.reset(FcConfigReference(nullptr)); + + FcInit(); SkDEBUGCODE(fontconfiginterface_unittest();) } @@ -541,7 +542,7 @@ bool SkFontConfigInterfaceDirect::isValidPattern(FcPattern* pattern) { if (!c_filename) { return false; } - const char* sysroot = (const char*)FcConfigGetSysRoot(fcConfig.get()); + const char* sysroot = (const char*)FcConfigGetSysRoot(nullptr); SkString resolvedFilename; if (sysroot) { resolvedFilename = sysroot; @@ -612,7 +613,7 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[], FcPatternAddBool(pattern, FC_SCALABLE, FcTrue); - FcConfigSubstitute(fcConfig.get(), pattern, FcMatchPattern); + FcConfigSubstitute(nullptr, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); // Font matching: @@ -651,7 +652,7 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[], } FcResult result; - FcFontSet* font_set = FcFontSort(fcConfig.get(), pattern, 0, nullptr, &result); + FcFontSet* font_set = FcFontSort(nullptr, pattern, 0, nullptr, &result); if (!font_set) { FcPatternDestroy(pattern); return false; @@ -679,7 +680,7 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[], FcFontSetDestroy(font_set); return false; } - const char* sysroot = (const char*)FcConfigGetSysRoot(fcConfig.get()); + const char* sysroot = (const char*)FcConfigGetSysRoot(nullptr); SkString resolvedFilename; if (sysroot) { resolvedFilename = sysroot; diff --git a/src/ports/SkFontConfigInterface_direct.h b/src/ports/SkFontConfigInterface_direct.h index 23b974a1c1..f31047f170 100644 --- a/src/ports/SkFontConfigInterface_direct.h +++ b/src/ports/SkFontConfigInterface_direct.h @@ -30,7 +30,6 @@ protected: virtual bool isAccessible(const char* filename); private: - std::unique_ptr> fcConfig; bool isValidPattern(FcPattern* pattern); FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family, const SkString& family);