aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGpuGLShaders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGpuGLShaders.cpp')
-rw-r--r--src/gpu/gl/GrGpuGLShaders.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGpuGLShaders.cpp b/src/gpu/gl/GrGpuGLShaders.cpp
index db7e3a7f76..cb156f7ae4 100644
--- a/src/gpu/gl/GrGpuGLShaders.cpp
+++ b/src/gpu/gl/GrGpuGLShaders.cpp
@@ -125,6 +125,7 @@ public:
void GrGpuGLShaders::abandonResources(){
INHERITED::abandonResources();
fProgramCache->abandon();
+ fHWProgramID = 0;
}
void GrGpuGLShaders::DeleteProgram(const GrGLInterface* gl,
@@ -326,6 +327,13 @@ GrGpuGLShaders::GrGpuGLShaders(const GrGLContextInfo& ctxInfo)
}
GrGpuGLShaders::~GrGpuGLShaders() {
+
+ if (fProgramData && 0 != fHWProgramID) {
+ // detach the current program so there is no confusion on OpenGL's part
+ // that we want it to be deleted
+ SkASSERT(fHWProgramID == fProgramData->fProgramID);
+ GL_CALL(UseProgram(0));
+ }
delete fProgramCache;
}