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

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

Issue 201153023: Adding a new SkSurface factory for generating surfaces from the scratch texture pool. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: build/typo fix Created 6 years, 9 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
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 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/gpu/GrResourceCache.h » ('j') | src/gpu/SkGpuDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698