| Index: src/ports/SkFontMgr_FontConfigInterface_factory.cpp
|
| diff --git a/src/ports/SkFontMgr_FontConfigInterface_factory.cpp b/src/ports/SkFontMgr_FontConfigInterface_factory.cpp
|
| index 0ffc26116f9880a86bf8c6ba43400eef2c76cf49..92ed3b4e517fae9f7b89adc25bfdf4da110c5163 100644
|
| --- a/src/ports/SkFontMgr_FontConfigInterface_factory.cpp
|
| +++ b/src/ports/SkFontMgr_FontConfigInterface_factory.cpp
|
| @@ -7,38 +7,17 @@
|
|
|
| #include "SkFontConfigInterface.h"
|
| #include "SkFontMgr.h"
|
| -#include "SkMutex.h"
|
| -#include "SkRefCnt.h"
|
| +#include "SkFontMgr_FontConfigInterface.h"
|
|
|
| -SK_DECLARE_STATIC_MUTEX(gFontConfigInterfaceMutex);
|
| -static SkFontConfigInterface* gFontConfigInterface;
|
| -
|
| -SkFontConfigInterface* SkFontConfigInterface::RefGlobal() {
|
| - SkAutoMutexAcquire ac(gFontConfigInterfaceMutex);
|
| -
|
| - return SkSafeRef(gFontConfigInterface);
|
| -}
|
| -
|
| -SkFontConfigInterface* SkFontConfigInterface::SetGlobal(SkFontConfigInterface* fc) {
|
| - SkAutoMutexAcquire ac(gFontConfigInterfaceMutex);
|
| -
|
| - SkRefCnt_SafeAssign(gFontConfigInterface, fc);
|
| - return fc;
|
| -}
|
| -
|
| -///////////////////////////////////////////////////////////////////////////////
|
| -
|
| -static SkFontConfigInterface* init_FCI() {
|
| - SkAutoMutexAcquire ac(gFontConfigInterfaceMutex);
|
| -
|
| - if (gFontConfigInterface) {
|
| - return SkRef(gFontConfigInterface);
|
| - }
|
| - gFontConfigInterface = SkRef(SkFontConfigInterface::GetSingletonDirectInterface());
|
| - return gFontConfigInterface;
|
| -}
|
| +#ifdef SK_ADDING_src_ports_SkFontConfigInterface_cpp
|
| +// The code previously here is moving to SkFontConfigInterface.cpp
|
| +#include "SkFontConfigInterface.cpp"
|
| +#endif
|
|
|
| SkFontMgr* SkFontMgr::Factory() {
|
| - SkFontConfigInterface* fci = init_FCI();
|
| - return fci ? SkFontMgr_New_FCI(fci) : nullptr;
|
| + sk_sp<SkFontConfigInterface> fci(SkFontConfigInterface::RefGlobal());
|
| + if (!fci) {
|
| + return nullptr;
|
| + }
|
| + return SkFontMgr_New_FCI(std::move(fci));
|
| }
|
|
|