summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-08-29 23:15:54 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-08-31 19:48:14 +0000
commitb27b9084c5b55f6cf6732fb9bdc253658ea612ea (patch)
treea7e4cad084a1e948a7c9cf1595f040edc0179e1f /vcl/source/opengl
parent1ba1a21aa6b77ef8d3d59b3658dfd2aa87d0dee2 (diff)
tdf#93772 - handle framebuffer unbinding on GL context switch.
Also start gl tests in vcldemo: $ SAL_FORCEGL=1 vcldemo --gltests Change-Id: I8f0022770d57cd60c830659e3f7fcc0721320a10 Reviewed-on: https://gerrit.libreoffice.org/18132 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index cb0535623c28..0d7e9cc8167a 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1566,6 +1566,7 @@ void OpenGLContext::ReleaseFramebuffer( OpenGLFramebuffer* pFramebuffer )
void OpenGLContext::ReleaseFramebuffer( const OpenGLTexture& rTexture )
{
OpenGLZone aZone;
+
OpenGLFramebuffer* pFramebuffer = mpLastFramebuffer;
while( pFramebuffer )
@@ -1574,6 +1575,8 @@ void OpenGLContext::ReleaseFramebuffer( const OpenGLTexture& rTexture )
{
BindFramebuffer( pFramebuffer );
pFramebuffer->DetachTexture();
+ if (mpCurrentFramebuffer == pFramebuffer)
+ BindFramebuffer( NULL );
}
pFramebuffer = pFramebuffer->mpPrevFramebuffer;
}
@@ -1582,6 +1585,7 @@ void OpenGLContext::ReleaseFramebuffer( const OpenGLTexture& rTexture )
void OpenGLContext::ReleaseFramebuffers()
{
OpenGLZone aZone;
+
OpenGLFramebuffer* pFramebuffer = mpLastFramebuffer;
while( pFramebuffer )
{
@@ -1592,6 +1596,7 @@ void OpenGLContext::ReleaseFramebuffers()
}
pFramebuffer = pFramebuffer->mpPrevFramebuffer;
}
+ BindFramebuffer( NULL );
}
OpenGLProgram* OpenGLContext::GetProgram( const OUString& rVertexShader, const OUString& rFragmentShader, const OString& preamble )