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

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

Issue 23904003: Remove GrRefCnt.h in favor of SkRefCnt.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rm GrRefCnt.h Created 7 years, 3 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/gpu/GrAtlas.cpp ('k') | src/gpu/GrDrawState.h » ('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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 fTextureCache = NULL; 160 fTextureCache = NULL;
161 delete fFontCache; 161 delete fFontCache;
162 delete fDrawBuffer; 162 delete fDrawBuffer;
163 delete fDrawBufferVBAllocPool; 163 delete fDrawBufferVBAllocPool;
164 delete fDrawBufferIBAllocPool; 164 delete fDrawBufferIBAllocPool;
165 165
166 fAARectRenderer->unref(); 166 fAARectRenderer->unref();
167 fOvalRenderer->unref(); 167 fOvalRenderer->unref();
168 168
169 fGpu->unref(); 169 fGpu->unref();
170 GrSafeUnref(fPathRendererChain); 170 SkSafeUnref(fPathRendererChain);
171 GrSafeUnref(fSoftwarePathRenderer); 171 SkSafeUnref(fSoftwarePathRenderer);
172 fDrawState->unref(); 172 fDrawState->unref();
173 173
174 --THREAD_INSTANCE_COUNT; 174 --THREAD_INSTANCE_COUNT;
175 } 175 }
176 176
177 void GrContext::contextLost() { 177 void GrContext::contextLost() {
178 this->contextDestroyed(); 178 this->contextDestroyed();
179 this->setupDrawBuffer(); 179 this->setupDrawBuffer();
180 } 180 }
181 181
182 void GrContext::contextDestroyed() { 182 void GrContext::contextDestroyed() {
183 // abandon first to so destructors 183 // abandon first to so destructors
184 // don't try to free the resources in the API. 184 // don't try to free the resources in the API.
185 fGpu->abandonResources(); 185 fGpu->abandonResources();
186 186
187 // a path renderer may be holding onto resources that 187 // a path renderer may be holding onto resources that
188 // are now unusable 188 // are now unusable
189 GrSafeSetNull(fPathRendererChain); 189 SkSafeSetNull(fPathRendererChain);
190 GrSafeSetNull(fSoftwarePathRenderer); 190 SkSafeSetNull(fSoftwarePathRenderer);
191 191
192 delete fDrawBuffer; 192 delete fDrawBuffer;
193 fDrawBuffer = NULL; 193 fDrawBuffer = NULL;
194 194
195 delete fDrawBufferVBAllocPool; 195 delete fDrawBufferVBAllocPool;
196 fDrawBufferVBAllocPool = NULL; 196 fDrawBufferVBAllocPool = NULL;
197 197
198 delete fDrawBufferIBAllocPool; 198 delete fDrawBufferIBAllocPool;
199 fDrawBufferIBAllocPool = NULL; 199 fDrawBufferIBAllocPool = NULL;
200 200
(...skipping 13 matching lines...) Expand all
214 this->flush(); 214 this->flush();
215 215
216 fGpu->purgeResources(); 216 fGpu->purgeResources();
217 217
218 fAARectRenderer->reset(); 218 fAARectRenderer->reset();
219 fOvalRenderer->reset(); 219 fOvalRenderer->reset();
220 220
221 fTextureCache->purgeAllUnlocked(); 221 fTextureCache->purgeAllUnlocked();
222 fFontCache->freeAll(); 222 fFontCache->freeAll();
223 // a path renderer may be holding onto resources 223 // a path renderer may be holding onto resources
224 GrSafeSetNull(fPathRendererChain); 224 SkSafeSetNull(fPathRendererChain);
225 GrSafeSetNull(fSoftwarePathRenderer); 225 SkSafeSetNull(fSoftwarePathRenderer);
226 } 226 }
227 227
228 size_t GrContext::getGpuTextureCacheBytes() const { 228 size_t GrContext::getGpuTextureCacheBytes() const {
229 return fTextureCache->getCachedResourceBytes(); 229 return fTextureCache->getCachedResourceBytes();
230 } 230 }
231 231
232 //////////////////////////////////////////////////////////////////////////////// 232 ////////////////////////////////////////////////////////////////////////////////
233 233
234 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc, 234 GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc,
235 const GrCacheID& cacheID, 235 const GrCacheID& cacheID,
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 return NULL; 1743 return NULL;
1744 } 1744 }
1745 } 1745 }
1746 1746
1747 /////////////////////////////////////////////////////////////////////////////// 1747 ///////////////////////////////////////////////////////////////////////////////
1748 #if GR_CACHE_STATS 1748 #if GR_CACHE_STATS
1749 void GrContext::printCacheStats() const { 1749 void GrContext::printCacheStats() const {
1750 fTextureCache->printStats(); 1750 fTextureCache->printStats();
1751 } 1751 }
1752 #endif 1752 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlas.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698