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

Side by Side Diff: include/gpu/GrCacheable.h

Issue 257093002: Add size change notifications to GrResourceCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 7 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 | « no previous file | include/gpu/GrTexture.h » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 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 GrCacheable_DEFINED 8 #ifndef GrCacheable_DEFINED
9 #define GrCacheable_DEFINED 9 #define GrCacheable_DEFINED
10 10
(...skipping 28 matching lines...) Expand all
39 virtual bool isValidOnGpu() const = 0; 39 virtual bool isValidOnGpu() const = 0;
40 40
41 void setCacheEntry(GrResourceCacheEntry* cacheEntry) { fCacheEntry = cacheEn try; } 41 void setCacheEntry(GrResourceCacheEntry* cacheEntry) { fCacheEntry = cacheEn try; }
42 GrResourceCacheEntry* getCacheEntry() { return fCacheEntry; } 42 GrResourceCacheEntry* getCacheEntry() { return fCacheEntry; }
43 43
44 protected: 44 protected:
45 GrCacheable() : fCacheEntry(NULL) {} 45 GrCacheable() : fCacheEntry(NULL) {}
46 46
47 bool isInCache() const { return NULL != fCacheEntry; } 47 bool isInCache() const { return NULL != fCacheEntry; }
48 48
49 /**
50 * This entry point should be called whenever gpuMemorySize() begins
51 * reporting a different size. If the object is in the cache, it will call
52 * gpuMemorySize() immediately and pass the new size on to the resource
53 * cache.
54 */
55 void didChangeGpuMemorySize() const;
56
49 private: 57 private:
50 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache 58 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache
51 59
52 typedef SkRefCnt INHERITED; 60 typedef SkRefCnt INHERITED;
53 }; 61 };
54 62
55 #endif 63 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698