Revert "Consolidate GrDrawingManager <-> GrRenderTask lifecycle"
This reverts commit 6f1487fe80c19c7a18a41d5a738d7ba2301929a9.
Reason for revert: http://crbug.com/1097620
Original change's description:
> Consolidate GrDrawingManager <-> GrRenderTask lifecycle
>
> This creates a funnel in the drawing manager (removeRenderTasks) that
> opens the door for tighter integration between the two classes. Also we
> add some assertions about the relationship and cut out duplicated code.
>
> Bug: skia:10372
> Change-Id: I0781ba7d45ac090cf7f6d430f0d56afe0f98b7e0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297195
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>
TBR=robertphillips@google.com,adlai@google.com
Change-Id: I5d34ada1838d206d8a33294427d459c36ad6b740
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298137
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 9fa242e..9dab791 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -56,7 +56,9 @@
GrContext::~GrContext() {
ASSERT_SINGLE_OWNER
- this->destroyDrawingManager();
+ if (this->drawingManager()) {
+ this->drawingManager()->cleanup();
+ }
fMappedBufferManager.reset();
delete fResourceProvider;
delete fResourceCache;
@@ -119,6 +121,10 @@
fResourceProvider->abandon();
+ // Need to cleanup the drawing manager first so all the render targets
+ // will be released/forgotten before they too are abandoned.
+ this->drawingManager()->cleanup();
+
// abandon first to so destructors
// don't try to free the resources in the API.
fResourceCache->abandonAll();
@@ -139,6 +145,10 @@
fResourceProvider->abandon();
+ // Need to cleanup the drawing manager first so all the render targets
+ // will be released/forgotten before they too are abandoned.
+ this->drawingManager()->cleanup();
+
// Release all resources in the backend 3D API.
fResourceCache->releaseAll();