OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |