| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 fAARectRenderer->unref(); | 169 fAARectRenderer->unref(); |
| 170 fOvalRenderer->unref(); | 170 fOvalRenderer->unref(); |
| 171 | 171 |
| 172 fGpu->unref(); | 172 fGpu->unref(); |
| 173 SkSafeUnref(fPathRendererChain); | 173 SkSafeUnref(fPathRendererChain); |
| 174 SkSafeUnref(fSoftwarePathRenderer); | 174 SkSafeUnref(fSoftwarePathRenderer); |
| 175 fDrawState->unref(); | 175 fDrawState->unref(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void GrContext::contextLost() { | 178 void GrContext::abandonContext() { |
| 179 this->contextDestroyed(); | |
| 180 this->setupDrawBuffer(); | |
| 181 } | |
| 182 | |
| 183 void GrContext::contextDestroyed() { | |
| 184 // abandon first to so destructors | 179 // abandon first to so destructors |
| 185 // don't try to free the resources in the API. | 180 // don't try to free the resources in the API. |
| 186 fGpu->abandonResources(); | 181 fGpu->abandonResources(); |
| 187 | 182 |
| 188 // a path renderer may be holding onto resources that | 183 // a path renderer may be holding onto resources that |
| 189 // are now unusable | 184 // are now unusable |
| 190 SkSafeSetNull(fPathRendererChain); | 185 SkSafeSetNull(fPathRendererChain); |
| 191 SkSafeSetNull(fSoftwarePathRenderer); | 186 SkSafeSetNull(fSoftwarePathRenderer); |
| 192 | 187 |
| 193 delete fDrawBuffer; | 188 delete fDrawBuffer; |
| (...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 fDrawBuffer->removeGpuTraceMarker(marker); | 1922 fDrawBuffer->removeGpuTraceMarker(marker); |
| 1928 } | 1923 } |
| 1929 } | 1924 } |
| 1930 | 1925 |
| 1931 /////////////////////////////////////////////////////////////////////////////// | 1926 /////////////////////////////////////////////////////////////////////////////// |
| 1932 #if GR_CACHE_STATS | 1927 #if GR_CACHE_STATS |
| 1933 void GrContext::printCacheStats() const { | 1928 void GrContext::printCacheStats() const { |
| 1934 fResourceCache->printStats(); | 1929 fResourceCache->printStats(); |
| 1935 } | 1930 } |
| 1936 #endif | 1931 #endif |
| OLD | NEW |