Index: src/ports/SkFontConfigInterface.cpp |
diff --git a/src/ports/SkFontMgr_FontConfigInterface_factory.cpp b/src/ports/SkFontConfigInterface.cpp |
similarity index 58% |
copy from src/ports/SkFontMgr_FontConfigInterface_factory.cpp |
copy to src/ports/SkFontConfigInterface.cpp |
index 0ffc26116f9880a86bf8c6ba43400eef2c76cf49..5b8731c3d07cc9d8abd0fe94376954424b03cd2b 100644 |
--- a/src/ports/SkFontMgr_FontConfigInterface_factory.cpp |
+++ b/src/ports/SkFontConfigInterface.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright 2008 Google Inc. |
+ * Copyright 2016 Google Inc. |
* |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
@@ -16,7 +16,10 @@ static SkFontConfigInterface* gFontConfigInterface; |
SkFontConfigInterface* SkFontConfigInterface::RefGlobal() { |
SkAutoMutexAcquire ac(gFontConfigInterfaceMutex); |
- return SkSafeRef(gFontConfigInterface); |
+ if (gFontConfigInterface) { |
+ return SkRef(gFontConfigInterface); |
+ } |
+ return SkSafeRef(SkFontConfigInterface::GetSingletonDirectInterface()); |
} |
SkFontConfigInterface* SkFontConfigInterface::SetGlobal(SkFontConfigInterface* fc) { |
@@ -25,20 +28,3 @@ SkFontConfigInterface* SkFontConfigInterface::SetGlobal(SkFontConfigInterface* f |
SkRefCnt_SafeAssign(gFontConfigInterface, fc); |
return fc; |
} |
- |
-/////////////////////////////////////////////////////////////////////////////// |
- |
-static SkFontConfigInterface* init_FCI() { |
- SkAutoMutexAcquire ac(gFontConfigInterfaceMutex); |
- |
- if (gFontConfigInterface) { |
- return SkRef(gFontConfigInterface); |
- } |
- gFontConfigInterface = SkRef(SkFontConfigInterface::GetSingletonDirectInterface()); |
- return gFontConfigInterface; |
-} |
- |
-SkFontMgr* SkFontMgr::Factory() { |
- SkFontConfigInterface* fci = init_FCI(); |
- return fci ? SkFontMgr_New_FCI(fci) : nullptr; |
-} |