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 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 fFontCache->freeAll(); | 213 fFontCache->freeAll(); |
214 // a path renderer may be holding onto resources | 214 // a path renderer may be holding onto resources |
215 SkSafeSetNull(fPathRendererChain); | 215 SkSafeSetNull(fPathRendererChain); |
216 SkSafeSetNull(fSoftwarePathRenderer); | 216 SkSafeSetNull(fSoftwarePathRenderer); |
217 } | 217 } |
218 | 218 |
219 size_t GrContext::getGpuTextureCacheBytes() const { | 219 size_t GrContext::getGpuTextureCacheBytes() const { |
220 return fTextureCache->getCachedResourceBytes(); | 220 return fTextureCache->getCachedResourceBytes(); |
221 } | 221 } |
222 | 222 |
| 223 int GrContext::getGpuTextureCacheResourceCount() const { |
| 224 return fTextureCache->getCachedResourceCount(); |
| 225 } |
| 226 |
223 //////////////////////////////////////////////////////////////////////////////// | 227 //////////////////////////////////////////////////////////////////////////////// |
224 | 228 |
225 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc, | 229 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc, |
226 const GrCacheID& cacheID, | 230 const GrCacheID& cacheID, |
227 const GrTextureParams* params) { | 231 const GrTextureParams* params) { |
228 GrResourceKey resourceKey = GrTexture::ComputeKey(fGpu, params, desc, cacheI
D); | 232 GrResourceKey resourceKey = GrTexture::ComputeKey(fGpu, params, desc, cacheI
D); |
229 GrResource* resource = fTextureCache->find(resourceKey); | 233 GrResource* resource = fTextureCache->find(resourceKey); |
230 SkSafeRef(resource); | 234 SkSafeRef(resource); |
231 return static_cast<GrTexture*>(resource); | 235 return static_cast<GrTexture*>(resource); |
232 } | 236 } |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 } | 1810 } |
1807 return path; | 1811 return path; |
1808 } | 1812 } |
1809 | 1813 |
1810 /////////////////////////////////////////////////////////////////////////////// | 1814 /////////////////////////////////////////////////////////////////////////////// |
1811 #if GR_CACHE_STATS | 1815 #if GR_CACHE_STATS |
1812 void GrContext::printCacheStats() const { | 1816 void GrContext::printCacheStats() const { |
1813 fTextureCache->printStats(); | 1817 fTextureCache->printStats(); |
1814 } | 1818 } |
1815 #endif | 1819 #endif |
OLD | NEW |