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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 fAARectRenderer->reset(); | 209 fAARectRenderer->reset(); |
210 fOvalRenderer->reset(); | 210 fOvalRenderer->reset(); |
211 | 211 |
212 fTextureCache->purgeAllUnlocked(); | 212 fTextureCache->purgeAllUnlocked(); |
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 void GrContext::purgeAllUnlocked() { | |
bsalomon
2013/12/18 14:51:36
How about purgeAllUnlockedResources ?
Should we
robertphillips
2013/12/18 15:59:13
Done.
| |
220 fTextureCache->purgeAllUnlocked(); | |
221 } | |
222 | |
223 | |
219 size_t GrContext::getGpuTextureCacheBytes() const { | 224 size_t GrContext::getGpuTextureCacheBytes() const { |
220 return fTextureCache->getCachedResourceBytes(); | 225 return fTextureCache->getCachedResourceBytes(); |
221 } | 226 } |
222 | 227 |
223 //////////////////////////////////////////////////////////////////////////////// | 228 //////////////////////////////////////////////////////////////////////////////// |
224 | 229 |
225 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc, | 230 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc, |
226 const GrCacheID& cacheID, | 231 const GrCacheID& cacheID, |
227 const GrTextureParams* params) { | 232 const GrTextureParams* params) { |
228 GrResourceKey resourceKey = GrTexture::ComputeKey(fGpu, params, desc, cacheI D); | 233 GrResourceKey resourceKey = GrTexture::ComputeKey(fGpu, params, desc, cacheI D); |
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1789 } | 1794 } |
1790 return path; | 1795 return path; |
1791 } | 1796 } |
1792 | 1797 |
1793 /////////////////////////////////////////////////////////////////////////////// | 1798 /////////////////////////////////////////////////////////////////////////////// |
1794 #if GR_CACHE_STATS | 1799 #if GR_CACHE_STATS |
1795 void GrContext::printCacheStats() const { | 1800 void GrContext::printCacheStats() const { |
1796 fTextureCache->printStats(); | 1801 fTextureCache->printStats(); |
1797 } | 1802 } |
1798 #endif | 1803 #endif |
OLD | NEW |