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

Unified Diff: src/gpu/GrContext.cpp

Issue 1852733002: Add GrContext::releaseAndAbandonContext() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-gpu build, add null check, add unit test" Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 1f6934d441523d792bf60970bbff7d8cf36645c0..1d6bb32142ce09b40c6ae401ced9ebfbdbffe561 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -148,7 +148,26 @@ void GrContext::abandonContext() {
// don't try to free the resources in the API.
fResourceCache->abandonAll();
- fGpu->contextAbandoned();
+ fGpu->disconnect(GrGpu::DisconnectType::kAbandon);
+
+ fBatchFontCache->freeAll();
+ fLayerCache->freeAll();
+ fTextBlobCache->freeAll();
+}
+
+void GrContext::releaseResourcesAndAbandonContext() {
+ ASSERT_SINGLE_OWNER
+
+ fResourceProvider->abandon();
+
+ // Need to abandon the drawing manager first so all the render targets
+ // will be released/forgotten before they too are abandoned.
+ fDrawingManager->abandon();
+
+ // Release all resources in the backend 3D API.
+ fResourceCache->releaseAll();
+
+ fGpu->disconnect(GrGpu::DisconnectType::kCleanup);
fBatchFontCache->freeAll();
fLayerCache->freeAll();
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698