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

Unified Diff: src/ports/SkFontConfigInterface_direct_factory.cpp

Issue 1936213002: Clean up SkFontConfigInterface implementation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkOnce Created 4 years, 8 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
Index: src/ports/SkFontConfigInterface_direct_factory.cpp
diff --git a/src/ports/SkFontConfigInterface_direct_factory.cpp b/src/ports/SkFontConfigInterface_direct_factory.cpp
index 58dddab1b0c161cc04fdd5f0631ed288c08d671a..116ba8380ab82a01686e4800bbff5170b9cc07a5 100644
--- a/src/ports/SkFontConfigInterface_direct_factory.cpp
+++ b/src/ports/SkFontConfigInterface_direct_factory.cpp
@@ -5,16 +5,12 @@
* found in the LICENSE file.
*/
-/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
-
#include "SkFontConfigInterface_direct.h"
-#include "SkMutex.h"
+#include "SkOnce.h"
-SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBaseMutex* mutex) {
- SkAutoMutexAcquire ac(mutex);
- static SkFontConfigInterfaceDirect* singleton = nullptr;
- if (singleton == nullptr) {
- singleton = new SkFontConfigInterfaceDirect;
- }
+SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() {
+ static SkFontConfigInterface* singleton;
+ static SkOnce once;
+ once([]{ singleton = new SkFontConfigInterfaceDirect(); });
return singleton;
}
« no previous file with comments | « src/ports/SkFontConfigInterface_direct.cpp ('k') | src/ports/SkFontConfigInterface_direct_google3_factory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698