summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-06-12 02:45:54 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-06-12 13:24:03 +0000
commitb6d0c53e514565bf9fbe8500800f0c6ece40806e (patch)
tree4668a8b6dae7a5b140dae7d5268c2a5b2e24ce0f /vcl
parent7b2e70f0c83dc333f3ad2e4584703c306269f466 (diff)
get rid of a few thousand unnecessary OpenGL calls
For each iteration of the (gtk) main loop we are dropping the yield mutext which results in calling OpenGLContext::clearCurrent. That method calls OpenGLContext::ReleaseFramebuffers which would call in the end glBindFramebuffer for each framebuffer related to that context. This would easily grow into the thousand OpenGL calls without doing any work. Change-Id: I209cc534fe58a5e11ef7df7f850a787916b8bd43 Reviewed-on: https://gerrit.libreoffice.org/16241 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 0c713bdfa83b..ab8ba12acd89 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1581,8 +1581,11 @@ void OpenGLContext::ReleaseFramebuffers()
OpenGLFramebuffer* pFramebuffer = mpLastFramebuffer;
while( pFramebuffer )
{
- BindFramebuffer( pFramebuffer );
- pFramebuffer->DetachTexture();
+ if (!pFramebuffer->IsFree())
+ {
+ BindFramebuffer( pFramebuffer );
+ pFramebuffer->DetachTexture();
+ }
pFramebuffer = pFramebuffer->mpPrevFramebuffer;
}
}