Index: src/core/SkGlyphCache.cpp |
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp |
index 7256de6cdc396ef6f35eb79a08b7a612358986c5..309f494828231cd0697ec981f81afbde367f1c7f 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 "SkOnce.h" |
+#include "SkOncePtr.h" |
#include "SkPath.h" |
#include "SkTemplates.h" |
#include "SkTraceMemoryDump.h" |
@@ -23,12 +23,9 @@ |
} // namespace |
// Returns the shared globals |
+SK_DECLARE_STATIC_ONCE_PTR(SkGlyphCache_Globals, globals); |
static SkGlyphCache_Globals& get_globals() { |
- static SkOnce once; |
- static SkGlyphCache_Globals* globals; |
- |
- once([]{ globals = new SkGlyphCache_Globals; }); |
- return *globals; |
+ return *globals.get([]{ return new SkGlyphCache_Globals; }); |
} |
/////////////////////////////////////////////////////////////////////////////// |