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

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

Issue 422903002: Test abandoning GL context in dm/nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix build Created 6 years, 4 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
« no previous file with comments | « include/gpu/GrContextFactory.h ('k') | tools/flags/SkCommonFlags.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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « include/gpu/GrContextFactory.h ('k') | tools/flags/SkCommonFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698