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

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

Issue 1082783002: Make GrContext::freeGpuResources() purge the resource cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « 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 2011 Google Inc. 3 * Copyright 2011 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 #include "GrContext.h" 9 #include "GrContext.h"
10 10
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 fAARectRenderer->reset(); 209 fAARectRenderer->reset();
210 fOvalRenderer->reset(); 210 fOvalRenderer->reset();
211 211
212 fBatchFontCache->freeAll(); 212 fBatchFontCache->freeAll();
213 fFontCache->freeAll(); 213 fFontCache->freeAll();
214 fLayerCache->freeAll(); 214 fLayerCache->freeAll();
215 // a path renderer may be holding onto resources 215 // a path renderer may be holding onto resources
216 SkSafeSetNull(fPathRendererChain); 216 SkSafeSetNull(fPathRendererChain);
217 SkSafeSetNull(fSoftwarePathRenderer); 217 SkSafeSetNull(fSoftwarePathRenderer);
218
219 fResourceCache->purgeAllUnlocked();
218 } 220 }
219 221
220 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const { 222 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const {
221 if (resourceCount) { 223 if (resourceCount) {
222 *resourceCount = fResourceCache->getBudgetedResourceCount(); 224 *resourceCount = fResourceCache->getBudgetedResourceCount();
223 } 225 }
224 if (resourceBytes) { 226 if (resourceBytes) {
225 *resourceBytes = fResourceCache->getBudgetedResourceBytes(); 227 *resourceBytes = fResourceCache->getBudgetedResourceBytes();
226 } 228 }
227 } 229 }
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 } 2029 }
2028 } 2030 }
2029 2031
2030 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { 2032 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) {
2031 fGpu->removeGpuTraceMarker(marker); 2033 fGpu->removeGpuTraceMarker(marker);
2032 if (fDrawBuffer) { 2034 if (fDrawBuffer) {
2033 fDrawBuffer->removeGpuTraceMarker(marker); 2035 fDrawBuffer->removeGpuTraceMarker(marker);
2034 } 2036 }
2035 } 2037 }
2036 2038
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