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

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

Issue 755193003: Fix early out in GrResourceCache2::purgeAsNeeded (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | 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 /* 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void removeResource(GrGpuResource*); 160 void removeResource(GrGpuResource*);
161 void notifyPurgable(GrGpuResource*); 161 void notifyPurgable(GrGpuResource*);
162 void didChangeGpuMemorySize(const GrGpuResource*, size_t oldSize); 162 void didChangeGpuMemorySize(const GrGpuResource*, size_t oldSize);
163 bool didSetContentKey(GrGpuResource*); 163 bool didSetContentKey(GrGpuResource*);
164 void willRemoveScratchKey(const GrGpuResource*); 164 void willRemoveScratchKey(const GrGpuResource*);
165 void didChangeBudgetStatus(GrGpuResource*); 165 void didChangeBudgetStatus(GrGpuResource*);
166 void makeResourceMRU(GrGpuResource*); 166 void makeResourceMRU(GrGpuResource*);
167 /// @} 167 /// @}
168 168
169 void purgeAsNeeded() { 169 void purgeAsNeeded() {
170 if (fPurging || (fBudgetedCount <= fMaxCount && fBudgetedBytes < fMaxByt es)) { 170 if (fPurging || (fBudgetedCount <= fMaxCount && fBudgetedBytes <= fMaxBy tes)) {
171 return; 171 return;
172 } 172 }
173 this->internalPurgeAsNeeded(); 173 this->internalPurgeAsNeeded();
174 } 174 }
175 175
176 void internalPurgeAsNeeded(); 176 void internalPurgeAsNeeded();
177 177
178 #ifdef SK_DEBUG 178 #ifdef SK_DEBUG
179 bool isInCache(const GrGpuResource* r) const { return fResources.isInList(r) ; } 179 bool isInCache(const GrGpuResource* r) const { return fResources.isInList(r) ; }
180 void validate() const; 180 void validate() const;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 friend class GrGpuResource; // To access all the proxy inline methods. 299 friend class GrGpuResource; // To access all the proxy inline methods.
300 friend class GrResourceCache2; // To create this type. 300 friend class GrResourceCache2; // To create this type.
301 }; 301 };
302 302
303 inline GrResourceCache2::ResourceAccess GrResourceCache2::resourceAccess() { 303 inline GrResourceCache2::ResourceAccess GrResourceCache2::resourceAccess() {
304 return ResourceAccess(this); 304 return ResourceAccess(this);
305 } 305 }
306 306
307 #endif 307 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698