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

Unified Diff: src/gpu/gl/GrGpuGL.cpp

Issue 481443002: Add GrResourceCache2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix leaks 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index e7daa6b6592bf777d5ca213f98b64957dd9bd0be..41071fb6421399bd09df78dfe0988e6883563e79 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -159,14 +159,20 @@ GrGpuGL::~GrGpuGL() {
SkASSERT(fHWProgramID == fCurrentProgram->programID());
GL_CALL(UseProgram(0));
}
-
+
delete fProgramCache;
// This must be called by before the GrDrawTarget destructor
this->releaseGeometry();
- // This subclass must do this before the base class destructor runs
- // since we will unref the GrGLInterface.
- this->releaseResources();
+}
+
+void GrGpuGL::contextAbandonded() {
+ INHERITED::contextAbandonded();
+ fProgramCache->abandon();
+ fHWProgramID = 0;
+ if (this->glCaps().pathRenderingSupport()) {
+ this->glPathRendering()->abandonGpuResources();
+ }
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698