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

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

Issue 18461007: Fix two leaks & improve leak tracking (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/doc/SkDocument.cpp ('k') | src/gpu/GrOvalRenderer.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 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 delete fDrawBuffer; 191 delete fDrawBuffer;
192 fDrawBuffer = NULL; 192 fDrawBuffer = NULL;
193 193
194 delete fDrawBufferVBAllocPool; 194 delete fDrawBufferVBAllocPool;
195 fDrawBufferVBAllocPool = NULL; 195 fDrawBufferVBAllocPool = NULL;
196 196
197 delete fDrawBufferIBAllocPool; 197 delete fDrawBufferIBAllocPool;
198 fDrawBufferIBAllocPool = NULL; 198 fDrawBufferIBAllocPool = NULL;
199 199
200 fAARectRenderer->reset(); 200 fAARectRenderer->reset();
201 fOvalRenderer->reset();
201 202
202 fTextureCache->purgeAllUnlocked(); 203 fTextureCache->purgeAllUnlocked();
203 fFontCache->freeAll(); 204 fFontCache->freeAll();
204 fGpu->markContextDirty(); 205 fGpu->markContextDirty();
205 } 206 }
206 207
207 void GrContext::resetContext(uint32_t state) { 208 void GrContext::resetContext(uint32_t state) {
208 fGpu->markContextDirty(state); 209 fGpu->markContextDirty(state);
209 } 210 }
210 211
211 void GrContext::freeGpuResources() { 212 void GrContext::freeGpuResources() {
212 this->flush(); 213 this->flush();
213 214
214 fGpu->purgeResources(); 215 fGpu->purgeResources();
215 216
216 fAARectRenderer->reset(); 217 fAARectRenderer->reset();
218 fOvalRenderer->reset();
217 219
218 fTextureCache->purgeAllUnlocked(); 220 fTextureCache->purgeAllUnlocked();
219 fFontCache->freeAll(); 221 fFontCache->freeAll();
220 // a path renderer may be holding onto resources 222 // a path renderer may be holding onto resources
221 GrSafeSetNull(fPathRendererChain); 223 GrSafeSetNull(fPathRendererChain);
222 GrSafeSetNull(fSoftwarePathRenderer); 224 GrSafeSetNull(fSoftwarePathRenderer);
223 } 225 }
224 226
225 size_t GrContext::getGpuTextureCacheBytes() const { 227 size_t GrContext::getGpuTextureCacheBytes() const {
226 return fTextureCache->getCachedResourceBytes(); 228 return fTextureCache->getCachedResourceBytes();
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 return srcTexture; 1857 return srcTexture;
1856 } 1858 }
1857 } 1859 }
1858 1860
1859 /////////////////////////////////////////////////////////////////////////////// 1861 ///////////////////////////////////////////////////////////////////////////////
1860 #if GR_CACHE_STATS 1862 #if GR_CACHE_STATS
1861 void GrContext::printCacheStats() const { 1863 void GrContext::printCacheStats() const {
1862 fTextureCache->printStats(); 1864 fTextureCache->printStats();
1863 } 1865 }
1864 #endif 1866 #endif
OLDNEW
« no previous file with comments | « src/doc/SkDocument.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698