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

Unified Diff: src/core/SkImageFilterCache.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/SkGlyphCache.cpp ('k') | src/core/SkMessageBus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilterCache.cpp
diff --git a/src/core/SkImageFilterCache.cpp b/src/core/SkImageFilterCache.cpp
index d87cf6b7c33840c85f4dc9a75842a98fd1a7dbd5..ba8a32c889b71c1a2dddc49537dd443d308fc37b 100644
--- a/src/core/SkImageFilterCache.cpp
+++ b/src/core/SkImageFilterCache.cpp
@@ -9,7 +9,7 @@
#include "SkChecksum.h"
#include "SkMutex.h"
-#include "SkOncePtr.h"
+#include "SkOnce.h"
#include "SkRefCnt.h"
#include "SkSpecialImage.h"
#include "SkTDynamicHash.h"
@@ -125,7 +125,10 @@ SkImageFilterCache* SkImageFilterCache::Create(size_t maxBytes) {
return new CacheImpl(maxBytes);
}
-SK_DECLARE_STATIC_ONCE_PTR(SkImageFilterCache, cache);
SkImageFilterCache* SkImageFilterCache::Get() {
- return cache.get([]{ return SkImageFilterCache::Create(kDefaultCacheSize); });
+ static SkOnce once;
+ static SkImageFilterCache* cache;
+
+ once([]{ cache = SkImageFilterCache::Create(kDefaultCacheSize); });
+ return cache;
}
« no previous file with comments | « src/core/SkGlyphCache.cpp ('k') | src/core/SkMessageBus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698