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

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

Issue 879963003: Fix GPU resource cache related assertions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « src/gpu/GrContext.cpp ('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 /* 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 9
10 #include "GrResourceCache2.h" 10 #include "GrResourceCache2.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 resource = fScratchMap.find(scratchKey, AvailableForScratchUse(false)); 210 resource = fScratchMap.find(scratchKey, AvailableForScratchUse(false));
211 if (resource) { 211 if (resource) {
212 resource->ref(); 212 resource->ref();
213 this->makeResourceMRU(resource); 213 this->makeResourceMRU(resource);
214 this->validate(); 214 this->validate();
215 } 215 }
216 return resource; 216 return resource;
217 } 217 }
218 218
219 void GrResourceCache2::willRemoveScratchKey(const GrGpuResource* resource) { 219 void GrResourceCache2::willRemoveScratchKey(const GrGpuResource* resource) {
220 SkASSERT(resource->cacheAccess().isScratch()); 220 SkASSERT(resource->cacheAccess().getScratchKey().isValid());
221 fScratchMap.remove(resource->cacheAccess().getScratchKey(), resource); 221 fScratchMap.remove(resource->cacheAccess().getScratchKey(), resource);
222 } 222 }
223 223
224 bool GrResourceCache2::didSetContentKey(GrGpuResource* resource) { 224 bool GrResourceCache2::didSetContentKey(GrGpuResource* resource) {
225 SkASSERT(!fPurging); 225 SkASSERT(!fPurging);
226 SkASSERT(resource); 226 SkASSERT(resource);
227 SkASSERT(this->isInCache(resource)); 227 SkASSERT(this->isInCache(resource));
228 SkASSERT(resource->cacheAccess().getContentKey().isValid()); 228 SkASSERT(resource->cacheAccess().getContentKey().isValid());
229 229
230 GrGpuResource* res = fContentHash.find(resource->cacheAccess().getContentKey ()); 230 GrGpuResource* res = fContentHash.find(resource->cacheAccess().getContentKey ());
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 SkDebugf("Budget: %d items %d bytes\n", fMaxCount, fMaxBytes); 517 SkDebugf("Budget: %d items %d bytes\n", fMaxCount, fMaxBytes);
518 SkDebugf("\t\tEntry Count: current %d" 518 SkDebugf("\t\tEntry Count: current %d"
519 " (%d budgeted, %d wrapped, %d locked, %d scratch %.2g%% full), hig h %d\n", 519 " (%d budgeted, %d wrapped, %d locked, %d scratch %.2g%% full), hig h %d\n",
520 fCount, fBudgetedCount, wrapped, locked, scratch, countUtilization, fHig hWaterCount); 520 fCount, fBudgetedCount, wrapped, locked, scratch, countUtilization, fHig hWaterCount);
521 SkDebugf("\t\tEntry Bytes: current %d (budgeted %d, %.2g%% full, %d unbudget ed) high %d\n", 521 SkDebugf("\t\tEntry Bytes: current %d (budgeted %d, %.2g%% full, %d unbudget ed) high %d\n",
522 fBytes, fBudgetedBytes, byteUtilization, unbudgetedSize, fHighWa terBytes); 522 fBytes, fBudgetedBytes, byteUtilization, unbudgetedSize, fHighWa terBytes);
523 } 523 }
524 524
525 #endif 525 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698