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

Unified Diff: src/core/SkImageFilterCache.cpp

Issue 1948313002: Revert of SkOncePtr -> SkOnce (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 ba8a32c889b71c1a2dddc49537dd443d308fc37b..d87cf6b7c33840c85f4dc9a75842a98fd1a7dbd5 100644
--- a/src/core/SkImageFilterCache.cpp
+++ b/src/core/SkImageFilterCache.cpp
@@ -9,7 +9,7 @@
#include "SkChecksum.h"
#include "SkMutex.h"
-#include "SkOnce.h"
+#include "SkOncePtr.h"
#include "SkRefCnt.h"
#include "SkSpecialImage.h"
#include "SkTDynamicHash.h"
@@ -125,10 +125,7 @@
return new CacheImpl(maxBytes);
}
+SK_DECLARE_STATIC_ONCE_PTR(SkImageFilterCache, cache);
SkImageFilterCache* SkImageFilterCache::Get() {
- static SkOnce once;
- static SkImageFilterCache* cache;
-
- once([]{ cache = SkImageFilterCache::Create(kDefaultCacheSize); });
- return cache;
+ return cache.get([]{ return SkImageFilterCache::Create(kDefaultCacheSize); });
}
« 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