| Index: src/core/SkImageFilter.cpp
|
| diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
|
| index 32562946ed54c2baa82fbd8c2a4e39f35ac814ce..ffb1f836d890ef1b1cad7a520d7857e1b75411c5 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,24 +560,19 @@ private:
|
| 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_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
|
| -
|
| +SK_DECLARE_STATIC_ONCE_PTR(SkImageFilter::Cache, cache);
|
| SkImageFilter::Cache* SkImageFilter::Cache::Get() {
|
| - return cache.get();
|
| + return cache.get([]{ return SkImageFilter::Cache::Create(kDefaultCacheSize); });
|
| }
|
|
|
| void SkImageFilter::PurgeCache() {
|
| - cache.get()->purge();
|
| + Cache::Get()->purge();
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|