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

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

Issue 729683002: Make GrResourceCache2 responsible for calling release, abandon, and ~. (Closed) Base URL: https://skia.googlesource.com/skia.git@revrev
Patch Set: tiny cleanup 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/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrResourceCache2.cpp » ('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 GrResourceCache2_DEFINED 9 #ifndef GrResourceCache2_DEFINED
10 #define GrResourceCache2_DEFINED 10 #define GrResourceCache2_DEFINED
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 #if GR_GPU_STATS 141 #if GR_GPU_STATS
142 void printStats() const; 142 void printStats() const;
143 #endif 143 #endif
144 144
145 private: 145 private:
146 /////////////////////////////////////////////////////////////////////////// 146 ///////////////////////////////////////////////////////////////////////////
147 /// @name Methods accessible via ResourceAccess 147 /// @name Methods accessible via ResourceAccess
148 //// 148 ////
149 void insertResource(GrGpuResource*); 149 void insertResource(GrGpuResource*);
150 void removeResource(GrGpuResource*); 150 void removeResource(GrGpuResource*);
151 void notifyPurgable(const GrGpuResource*); 151 void notifyPurgable(GrGpuResource*);
152 void didChangeGpuMemorySize(const GrGpuResource*, size_t oldSize); 152 void didChangeGpuMemorySize(const GrGpuResource*, size_t oldSize);
153 bool didSetContentKey(GrGpuResource*); 153 bool didSetContentKey(GrGpuResource*);
154 void makeResourceMRU(GrGpuResource*); 154 void makeResourceMRU(GrGpuResource*);
155 /// @} 155 /// @}
156 156
157 void purgeAsNeeded() { 157 void purgeAsNeeded() {
158 if (fPurging || (fCount <= fMaxCount && fBytes < fMaxBytes)) { 158 if (fPurging || (fCount <= fMaxCount && fBytes < fMaxBytes)) {
159 return; 159 return;
160 } 160 }
161 this->internalPurgeAsNeeded(); 161 this->internalPurgeAsNeeded();
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 void insertResource(GrGpuResource* resource) { fCache->insertResource(resour ce); } 234 void insertResource(GrGpuResource* resource) { fCache->insertResource(resour ce); }
235 235
236 /** 236 /**
237 * Removes a resource from the cache. 237 * Removes a resource from the cache.
238 */ 238 */
239 void removeResource(GrGpuResource* resource) { fCache->removeResource(resour ce); } 239 void removeResource(GrGpuResource* resource) { fCache->removeResource(resour ce); }
240 240
241 /** 241 /**
242 * Called by GrGpuResources when they detects that they are newly purgable. 242 * Called by GrGpuResources when they detects that they are newly purgable.
243 */ 243 */
244 void notifyPurgable(const GrGpuResource* resource) { fCache->notifyPurgable( resource); } 244 void notifyPurgable(GrGpuResource* resource) { fCache->notifyPurgable(resour ce); }
245 245
246 /** 246 /**
247 * Called by GrGpuResources when their sizes change. 247 * Called by GrGpuResources when their sizes change.
248 */ 248 */
249 void didChangeGpuMemorySize(const GrGpuResource* resource, size_t oldSize) { 249 void didChangeGpuMemorySize(const GrGpuResource* resource, size_t oldSize) {
250 fCache->didChangeGpuMemorySize(resource, oldSize); 250 fCache->didChangeGpuMemorySize(resource, oldSize);
251 } 251 }
252 252
253 /** 253 /**
254 * Called by GrGpuResources when their content keys change. 254 * Called by GrGpuResources when their content keys change.
(...skipping 13 matching lines...) Expand all
268 268
269 friend class GrGpuResource; // To access all the proxy inline methods. 269 friend class GrGpuResource; // To access all the proxy inline methods.
270 friend class GrResourceCache2; // To create this type. 270 friend class GrResourceCache2; // To create this type.
271 }; 271 };
272 272
273 inline GrResourceCache2::ResourceAccess GrResourceCache2::resourceAccess() { 273 inline GrResourceCache2::ResourceAccess GrResourceCache2::resourceAccess() {
274 return ResourceAccess(this); 274 return ResourceAccess(this);
275 } 275 }
276 276
277 #endif 277 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrResourceCache2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698