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

Unified Diff: src/core/SkImageFilter.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/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/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index ffb1f836d890ef1b1cad7a520d7857e1b75411c5..32562946ed54c2baa82fbd8c2a4e39f35ac814ce 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -11,9 +11,9 @@
#include "SkBitmapDevice.h"
#include "SkChecksum.h"
#include "SkDevice.h"
+#include "SkLazyPtr.h"
#include "SkMatrixImageFilter.h"
#include "SkMutex.h"
-#include "SkOncePtr.h"
#include "SkReadBuffer.h"
#include "SkRect.h"
#include "SkTDynamicHash.h"
@@ -560,19 +560,24 @@
mutable SkMutex fMutex;
};
+SkImageFilter::Cache* CreateCache() {
+ return SkImageFilter::Cache::Create(kDefaultCacheSize);
+}
+
} // namespace
SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) {
return new CacheImpl(maxBytes);
}
-SK_DECLARE_STATIC_ONCE_PTR(SkImageFilter::Cache, cache);
+SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
+
SkImageFilter::Cache* SkImageFilter::Cache::Get() {
- return cache.get([]{ return SkImageFilter::Cache::Create(kDefaultCacheSize); });
+ return cache.get();
}
void SkImageFilter::PurgeCache() {
- Cache::Get()->purge();
+ cache.get()->purge();
}
///////////////////////////////////////////////////////////////////////////////////////////////////
« 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