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

Unified Diff: src/core/SkGlyphCache.cpp

Issue 1334523002: Revert of Port uses of SkLazyPtr to SkOncePtr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/SkImageFilter.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 9bee4e5f757381be74089122555bbc881e5a1423..309707c66fede82e8ee775b7d545b3984e44001f 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 "SkLazyPtr.h"
#include "SkPath.h"
#include "SkTemplates.h"
#include "SkTraceMemoryDump.h"
@@ -17,6 +17,8 @@
//#define SPEW_PURGE_STATUS
namespace {
+
+SkGlyphCache_Globals* create_globals() { return new SkGlyphCache_Globals; }
const char gGlyphCacheDumpName[] = "skia/sk_glyph_cache";
@@ -28,10 +30,11 @@
} // 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 new SkGlyphCache_Globals; });
+ return *globals.get();
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/core/SkFontMgr.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698