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

Side by Side Diff: src/gpu/GrGpuResourceCacheAccess.h

Issue 720033004: Correct accounting for wrapped resources (Closed) Base URL: https://skia.googlesource.com/skia.git@res2
Patch Set: rebase again Created 6 years, 1 month 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
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache2.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef GrGpuResourceCacheAccess_DEFINED 9 #ifndef GrGpuResourceCacheAccess_DEFINED
10 #define GrGpuResourceCacheAccess_DEFINED 10 #define GrGpuResourceCacheAccess_DEFINED
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 /** 47 /**
48 * If the resource is currently cached by a content key, the key is returned , otherwise NULL. 48 * If the resource is currently cached by a content key, the key is returned , otherwise NULL.
49 */ 49 */
50 const GrResourceKey* getContentKey() const { 50 const GrResourceKey* getContentKey() const {
51 if (fResource->fContentKeySet) { 51 if (fResource->fContentKeySet) {
52 return &fResource->fContentKey; 52 return &fResource->fContentKey;
53 } 53 }
54 return NULL; 54 return NULL;
55 } 55 }
56 56
57 bool isWrapped() const { return fResource->isWrapped(); }
58
57 /** 59 /**
58 * Called by the cache to delete the resource under normal circumstances. 60 * Called by the cache to delete the resource under normal circumstances.
59 */ 61 */
60 void release() { 62 void release() {
61 fResource->release(); 63 fResource->release();
62 if (fResource->isPurgable()) { 64 if (fResource->isPurgable()) {
63 SkDELETE(fResource); 65 SkDELETE(fResource);
64 } 66 }
65 } 67 }
66 68
(...skipping 21 matching lines...) Expand all
88 friend class GrGpuResource; // to construct/copy this type. 90 friend class GrGpuResource; // to construct/copy this type.
89 }; 91 };
90 92
91 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc ess(this); } 93 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc ess(this); }
92 94
93 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const { 95 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const {
94 return CacheAccess(const_cast<GrGpuResource*>(this)); 96 return CacheAccess(const_cast<GrGpuResource*>(this));
95 } 97 }
96 98
97 #endif 99 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698