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

Unified Diff: src/core/SkGlyphCache.cpp

Issue 1953533002: SkOncePtr -> SkOnce (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: hide sk_num_cores() 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/SkFontMgr.cpp ('k') | src/core/SkImageFilterCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGlyphCache.cpp
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index 309f494828231cd0697ec981f81afbde367f1c7f..7256de6cdc396ef6f35eb79a08b7a612358986c5 100644
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -8,7 +8,7 @@
#include "SkGlyphCache.h"
#include "SkGlyphCache_Globals.h"
#include "SkGraphics.h"
-#include "SkOncePtr.h"
+#include "SkOnce.h"
#include "SkPath.h"
#include "SkTemplates.h"
#include "SkTraceMemoryDump.h"
@@ -23,9 +23,12 @@ const char gGlyphCacheDumpName[] = "skia/sk_glyph_cache";
} // namespace
// Returns the shared globals
-SK_DECLARE_STATIC_ONCE_PTR(SkGlyphCache_Globals, globals);
static SkGlyphCache_Globals& get_globals() {
- return *globals.get([]{ return new SkGlyphCache_Globals; });
+ static SkOnce once;
+ static SkGlyphCache_Globals* globals;
+
+ once([]{ globals = new SkGlyphCache_Globals; });
+ return *globals;
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/core/SkFontMgr.cpp ('k') | src/core/SkImageFilterCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698