Index: src/gpu/GrDrawingManager.cpp |
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp |
index 976fbb62a49e0c8ec499ce7f0a66fb6afa295cca..8847efab67ca6d595471c61c61ffc15d01faf99c 100644 |
--- a/src/gpu/GrDrawingManager.cpp |
+++ b/src/gpu/GrDrawingManager.cpp |
@@ -8,6 +8,7 @@ |
#include "GrDrawContext.h" |
#include "GrDrawingManager.h" |
#include "GrDrawTarget.h" |
+#include "GrInstancedRendering.h" |
#include "GrPathRenderingDrawContext.h" |
#include "GrResourceProvider.h" |
#include "GrSoftwarePathRenderer.h" |
@@ -40,6 +41,11 @@ GrDrawingManager::~GrDrawingManager() { |
void GrDrawingManager::abandon() { |
fAbandoned = true; |
+ for (int i = 0; i < fDrawTargets.count(); ++i) { |
+ if (GrInstancedRendering* ir = fDrawTargets[i]->instancedRendering()) { |
+ ir->resetGpuResources(GrInstancedRendering::ResetType::kAbandon); |
+ } |
+ } |
this->cleanup(); |
} |
@@ -48,6 +54,11 @@ void GrDrawingManager::freeGpuResources() { |
delete fPathRendererChain; |
fPathRendererChain = nullptr; |
SkSafeSetNull(fSoftwarePathRenderer); |
+ for (int i = 0; i < fDrawTargets.count(); ++i) { |
+ if (GrInstancedRendering* ir = fDrawTargets[i]->instancedRendering()) { |
+ ir->resetGpuResources(GrInstancedRendering::ResetType::kDestroy); |
+ } |
+ } |
} |
void GrDrawingManager::reset() { |