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 #include "GrContext.h" | 9 #include "GrContext.h" |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 | 186 |
187 delete fDrawBufferIBAllocPool; | 187 delete fDrawBufferIBAllocPool; |
188 fDrawBufferIBAllocPool = NULL; | 188 fDrawBufferIBAllocPool = NULL; |
189 | 189 |
190 fAARectRenderer->reset(); | 190 fAARectRenderer->reset(); |
191 fOvalRenderer->reset(); | 191 fOvalRenderer->reset(); |
192 | 192 |
193 fBatchFontCache->freeAll(); | 193 fBatchFontCache->freeAll(); |
194 fFontCache->freeAll(); | 194 fFontCache->freeAll(); |
195 fLayerCache->freeAll(); | 195 fLayerCache->freeAll(); |
196 fTextBlobCache->freeAll(); | |
196 } | 197 } |
197 | 198 |
198 void GrContext::resetContext(uint32_t state) { | 199 void GrContext::resetContext(uint32_t state) { |
199 fGpu->markContextDirty(state); | 200 fGpu->markContextDirty(state); |
200 } | 201 } |
201 | 202 |
202 void GrContext::freeGpuResources() { | 203 void GrContext::freeGpuResources() { |
203 this->flush(); | 204 this->flush(); |
204 | 205 |
205 if (fDrawBuffer) { | 206 if (fDrawBuffer) { |
206 fDrawBuffer->purgeResources(); | 207 fDrawBuffer->purgeResources(); |
207 } | 208 } |
208 | 209 |
209 fAARectRenderer->reset(); | 210 fAARectRenderer->reset(); |
210 fOvalRenderer->reset(); | 211 fOvalRenderer->reset(); |
211 | 212 |
212 fBatchFontCache->freeAll(); | 213 fBatchFontCache->freeAll(); |
213 fFontCache->freeAll(); | 214 fFontCache->freeAll(); |
214 fLayerCache->freeAll(); | 215 fLayerCache->freeAll(); |
216 fTextBlobCache->freeAll(); | |
bsalomon
2015/04/16 18:06:11
actually not sure we need this here. This function
joshualitt
2015/04/16 18:08:30
nope, good catch.
| |
215 // a path renderer may be holding onto resources | 217 // a path renderer may be holding onto resources |
216 SkSafeSetNull(fPathRendererChain); | 218 SkSafeSetNull(fPathRendererChain); |
217 SkSafeSetNull(fSoftwarePathRenderer); | 219 SkSafeSetNull(fSoftwarePathRenderer); |
218 | 220 |
219 fResourceCache->purgeAllUnlocked(); | 221 fResourceCache->purgeAllUnlocked(); |
220 } | 222 } |
221 | 223 |
222 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const { | 224 void GrContext::getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const { |
223 if (resourceCount) { | 225 if (resourceCount) { |
224 *resourceCount = fResourceCache->getBudgetedResourceCount(); | 226 *resourceCount = fResourceCache->getBudgetedResourceCount(); |
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2030 } | 2032 } |
2031 } | 2033 } |
2032 | 2034 |
2033 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { | 2035 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
2034 fGpu->removeGpuTraceMarker(marker); | 2036 fGpu->removeGpuTraceMarker(marker); |
2035 if (fDrawBuffer) { | 2037 if (fDrawBuffer) { |
2036 fDrawBuffer->removeGpuTraceMarker(marker); | 2038 fDrawBuffer->removeGpuTraceMarker(marker); |
2037 } | 2039 } |
2038 } | 2040 } |
2039 | 2041 |
OLD | NEW |