summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-08-31 12:11:50 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-08-31 20:18:54 +0100
commit18dd07ba4fd9ede98ce576e6024831658bbd5401 (patch)
tree013a6802b3a7089c1b62b68c4169d21ae0982799 /vcl/source/opengl
parent6cf43cf6b98866401702d3275a7a026d8fa01edf (diff)
tdf#93751 - ensure textures are unbound from framebuffers post destroy.
Change-Id: I81aec0e6f8db57905826c54c3442528be6068700
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 8253241795ea..cb0535623c28 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1537,6 +1537,26 @@ OpenGLFramebuffer* OpenGLContext::AcquireFramebuffer( const OpenGLTexture& rText
return pFramebuffer;
}
+// FIXME: this method is rather grim from a perf. perspective.
+// We should instead (eventually) use pointers to associate the
+// framebuffer and texture cleanly.
+void OpenGLContext::UnbindTextureFromFramebuffers( GLuint nTexture )
+{
+ OpenGLFramebuffer* pFramebuffer;
+
+ // see if there is a framebuffer attached to that texture
+ pFramebuffer = mpLastFramebuffer;
+ while( pFramebuffer )
+ {
+ if (pFramebuffer->IsAttached(nTexture))
+ {
+ BindFramebuffer(pFramebuffer);
+ pFramebuffer->DetachTexture();
+ }
+ pFramebuffer = pFramebuffer->mpPrevFramebuffer;
+ }
+}
+
void OpenGLContext::ReleaseFramebuffer( OpenGLFramebuffer* pFramebuffer )
{
if( pFramebuffer )