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

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

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 | « no previous file | src/gpu/GrGpuResource.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 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 fFontCache->freeAll(); 211 fFontCache->freeAll();
212 fLayerCache->freeAll(); 212 fLayerCache->freeAll();
213 // a path renderer may be holding onto resources 213 // a path renderer may be holding onto resources
214 SkSafeSetNull(fPathRendererChain); 214 SkSafeSetNull(fPathRendererChain);
215 SkSafeSetNull(fSoftwarePathRenderer); 215 SkSafeSetNull(fSoftwarePathRenderer);
216 } 216 }
217 217
218 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const { 218 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const {
219 if (resourceCount) { 219 if (resourceCount) {
220 *resourceCount = fResourceCache2->getResourceCount(); 220 *resourceCount = fResourceCache2->getBudgetedResourceCount();
221 } 221 }
222 if (resourceBytes) { 222 if (resourceBytes) {
223 *resourceBytes = fResourceCache2->getResourceBytes(); 223 *resourceBytes = fResourceCache2->getBudgetedResourceBytes();
224 } 224 }
225 } 225 }
226 226
227 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, 227 GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget,
228 const SkDeviceProperties& 228 const SkDeviceProperties&
229 leakyProperties, 229 leakyProperties,
230 bool enableDistanceFieldFonts) { 230 bool enableDistanceFieldFonts) {
231 if (fGpu->caps()->pathRenderingSupport() && renderTarget->getStencilBuffer() && 231 if (fGpu->caps()->pathRenderingSupport() && renderTarget->getStencilBuffer() &&
232 renderTarget->isMultisampled()) { 232 renderTarget->isMultisampled()) {
233 return GrStencilAndCoverTextContext::Create(this, leakyProperties); 233 return GrStencilAndCoverTextContext::Create(this, leakyProperties);
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 fResourceCache2->printStats(); 1757 fResourceCache2->printStats();
1758 } 1758 }
1759 #endif 1759 #endif
1760 1760
1761 #if GR_GPU_STATS 1761 #if GR_GPU_STATS
1762 const GrContext::GPUStats* GrContext::gpuStats() const { 1762 const GrContext::GPUStats* GrContext::gpuStats() const {
1763 return fGpu->gpuStats(); 1763 return fGpu->gpuStats();
1764 } 1764 }
1765 #endif 1765 #endif
1766 1766
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698