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

Unified Diff: src/core/SkFontMgr.cpp

Issue 1948313002: Revert of SkOncePtr -> SkOnce (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « src/core/SkData.cpp ('k') | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFontMgr.cpp
diff --git a/src/core/SkFontMgr.cpp b/src/core/SkFontMgr.cpp
index 0f0066792636837af660e610ab96ede11b5d7bb2..ebb9a8966207814024d2d6b5b66095c64882bf2e 100644
--- a/src/core/SkFontMgr.cpp
+++ b/src/core/SkFontMgr.cpp
@@ -7,7 +7,7 @@
#include "SkFontDescriptor.h"
#include "SkFontMgr.h"
-#include "SkOnce.h"
+#include "SkOncePtr.h"
#include "SkStream.h"
#include "SkTypes.h"
@@ -169,15 +169,12 @@
return this->onLegacyCreateTypeface(familyName, style);
}
+SK_DECLARE_STATIC_ONCE_PTR(SkFontMgr, singleton);
SkFontMgr* SkFontMgr::RefDefault() {
- static SkOnce once;
- static SkFontMgr* singleton;
-
- once([]{
+ return SkRef(singleton.get([]{
SkFontMgr* fm = SkFontMgr::Factory();
- singleton = fm ? fm : new SkEmptyFontMgr;
- });
- return SkRef(singleton);
+ return fm ? fm : new SkEmptyFontMgr;
+ }));
}
/**
« no previous file with comments | « src/core/SkData.cpp ('k') | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698