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

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

Issue 18612003: use typedef to name our ID type in SkImageCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/lazy/SkLruImageCache.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 SkPurgeableImageCache_DEFINED 8 #ifndef SkPurgeableImageCache_DEFINED
9 #define SkPurgeableImageCache_DEFINED 9 #define SkPurgeableImageCache_DEFINED
10 10
11 #include "SkImageCache.h" 11 #include "SkImageCache.h"
12 12
13 #ifdef SK_DEBUG 13 #ifdef SK_DEBUG
14 #include "SkTDArray.h" 14 #include "SkTDArray.h"
15 #endif 15 #endif
16 16
17 /** 17 /**
18 * Implementation for SkImageCache that uses system defined purgeable memory. 18 * Implementation for SkImageCache that uses system defined purgeable memory.
19 */ 19 */
20 class SkPurgeableImageCache : public SkImageCache { 20 class SkPurgeableImageCache : public SkImageCache {
21 21
22 public: 22 public:
23 static SkImageCache* Create(); 23 static SkImageCache* Create();
24 24
25 virtual void* allocAndPinCache(size_t bytes, intptr_t* ID) SK_OVERRIDE; 25 virtual void* allocAndPinCache(size_t bytes, ID*) SK_OVERRIDE;
26 virtual void* pinCache(intptr_t ID, SkImageCache::DataStatus*) SK_OVERRIDE; 26 virtual void* pinCache(ID, SkImageCache::DataStatus*) SK_OVERRIDE;
27 virtual void releaseCache(intptr_t ID) SK_OVERRIDE; 27 virtual void releaseCache(ID) SK_OVERRIDE;
28 virtual void throwAwayCache(intptr_t ID) SK_OVERRIDE; 28 virtual void throwAwayCache(ID) SK_OVERRIDE;
29 29
30 #ifdef SK_DEBUG 30 #ifdef SK_DEBUG
31 virtual MemoryStatus getMemoryStatus(intptr_t ID) const SK_OVERRIDE; 31 virtual MemoryStatus getMemoryStatus(ID) const SK_OVERRIDE;
32 virtual void purgeAllUnpinnedCaches() SK_OVERRIDE; 32 virtual void purgeAllUnpinnedCaches() SK_OVERRIDE;
33 virtual ~SkPurgeableImageCache(); 33 virtual ~SkPurgeableImageCache();
34 #endif 34 #endif
35 35
36 private: 36 private:
37 SkPurgeableImageCache(); 37 SkPurgeableImageCache();
38 38
39 #ifdef SK_DEBUG 39 #ifdef SK_DEBUG
40 SkTDArray<intptr_t> fRecs; 40 SkTDArray<ID> fRecs;
41 int findRec(intptr_t) const; 41 int findRec(ID) const;
42 #endif 42 #endif
43 void removeRec(intptr_t); 43 void removeRec(ID);
44 }; 44 };
45 #endif // SkPurgeableImageCache_DEFINED 45 #endif // SkPurgeableImageCache_DEFINED
OLDNEW
« no previous file with comments | « include/lazy/SkLruImageCache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698