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

Side by Side Diff: include/lazy/SkPurgeableImageCache.h

Issue 103033002: Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase one last time Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/lazy/SkLruImageCache.h ('k') | src/core/SkDiscardableMemory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkPurgeableImageCache_DEFINED
9 #define SkPurgeableImageCache_DEFINED
10
11 #include "SkImageCache.h"
12
13 #ifdef SK_DEBUG
14 #include "SkTDArray.h"
15 #endif
16
17 /**
18 * Implementation for SkImageCache that uses system defined purgeable memory.
19 */
20 class SkPurgeableImageCache : public SkImageCache {
21
22 public:
23 SK_DECLARE_INST_COUNT(SkPurgeableImageCache)
24
25 static SkImageCache* Create();
26
27 virtual void* allocAndPinCache(size_t bytes, ID*) SK_OVERRIDE;
28 virtual void* pinCache(ID, SkImageCache::DataStatus*) SK_OVERRIDE;
29 virtual void releaseCache(ID) SK_OVERRIDE;
30 virtual void throwAwayCache(ID) SK_OVERRIDE;
31
32 #ifdef SK_DEBUG
33 virtual MemoryStatus getMemoryStatus(ID) const SK_OVERRIDE;
34 virtual void purgeAllUnpinnedCaches() SK_OVERRIDE;
35 virtual ~SkPurgeableImageCache();
36 #endif
37
38 private:
39 SkPurgeableImageCache();
40
41 #ifdef SK_DEBUG
42 SkTDArray<ID> fRecs;
43 int findRec(ID) const;
44 #endif
45 void removeRec(ID);
46 typedef SkImageCache INHERITED;
47 };
48 #endif // SkPurgeableImageCache_DEFINED
OLDNEW
« no previous file with comments | « include/lazy/SkLruImageCache.h ('k') | src/core/SkDiscardableMemory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698