Index: src/core/SkGlyphCache.cpp |
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp |
index 309707c66fede82e8ee775b7d545b3984e44001f..9bee4e5f757381be74089122555bbc881e5a1423 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 "SkLazyPtr.h" |
+#include "SkOncePtr.h" |
#include "SkPath.h" |
#include "SkTemplates.h" |
#include "SkTraceMemoryDump.h" |
@@ -18,8 +18,6 @@ |
namespace { |
-SkGlyphCache_Globals* create_globals() { return new SkGlyphCache_Globals; } |
- |
const char gGlyphCacheDumpName[] = "skia/sk_glyph_cache"; |
// Used to pass context to the sk_trace_dump_visitor. |
@@ -30,11 +28,10 @@ struct SkGlyphCacheDumpContext { |
} // namespace |
-SK_DECLARE_STATIC_LAZY_PTR(SkGlyphCache_Globals, globals, create_globals); |
- |
// Returns the shared globals |
+SK_DECLARE_STATIC_ONCE_PTR(SkGlyphCache_Globals, globals); |
static SkGlyphCache_Globals& get_globals() { |
- return *globals.get(); |
+ return *globals.get([]{ return new SkGlyphCache_Globals; }); |
} |
/////////////////////////////////////////////////////////////////////////////// |