OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkLruImageCache_DEFINED | 8 #ifndef SkLruImageCache_DEFINED |
9 #define SkLruImageCache_DEFINED | 9 #define SkLruImageCache_DEFINED |
10 | 10 |
11 #include "SkImageCache.h" | 11 #include "SkImageCache.h" |
12 #include "SkThread.h" | 12 #include "SkThread.h" |
13 #include "SkTInternalLList.h" | 13 #include "SkTInternalLList.h" |
14 | 14 |
15 class CachedPixels; | 15 class CachedPixels; |
16 | 16 |
17 /** | 17 /** |
18 * SkImageCache implementation that uses an LRU cache to age out old images. | 18 * SkImageCache implementation that uses an LRU cache to age out old images. |
19 */ | 19 */ |
20 class SkLruImageCache : public SkImageCache { | 20 class SkLruImageCache : public SkImageCache { |
21 | 21 |
22 public: | 22 public: |
| 23 SK_DECLARE_INST_COUNT(SkLruImageCache) |
| 24 |
23 SkLruImageCache(size_t budget); | 25 SkLruImageCache(size_t budget); |
24 | 26 |
25 virtual ~SkLruImageCache(); | 27 virtual ~SkLruImageCache(); |
26 | 28 |
27 #ifdef SK_DEBUG | 29 #ifdef SK_DEBUG |
28 virtual MemoryStatus getMemoryStatus(ID) const SK_OVERRIDE; | 30 virtual MemoryStatus getMemoryStatus(ID) const SK_OVERRIDE; |
29 virtual void purgeAllUnpinnedCaches() SK_OVERRIDE; | 31 virtual void purgeAllUnpinnedCaches() SK_OVERRIDE; |
30 #endif | 32 #endif |
31 | 33 |
32 /** | 34 /** |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 */ | 82 */ |
81 void purgeTilAtOrBelow(size_t limit); | 83 void purgeTilAtOrBelow(size_t limit); |
82 | 84 |
83 /** | 85 /** |
84 * Remove a set of CachedPixels. Mutex must be locked before calling. | 86 * Remove a set of CachedPixels. Mutex must be locked before calling. |
85 */ | 87 */ |
86 void removePixels(CachedPixels*); | 88 void removePixels(CachedPixels*); |
87 }; | 89 }; |
88 | 90 |
89 #endif // SkLruImageCache_DEFINED | 91 #endif // SkLruImageCache_DEFINED |
OLD | NEW |