[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Sep 1 00:14:55 PDT 2015


 vcl/source/opengl/OpenGLContext.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 8cb5adc2c1ce42cda302b72ac145053bc906d7c6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jun 12 02:45:54 2015 +0200

    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 at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-on: https://gerrit.libreoffice.org/18218
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 5c64448..d4c2a83 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1633,8 +1633,11 @@ void OpenGLContext::ReleaseFramebuffers()
     OpenGLFramebuffer* pFramebuffer = mpLastFramebuffer;
     while( pFramebuffer )
     {
-        BindFramebuffer( pFramebuffer );
-        pFramebuffer->DetachTexture();
+        if (!pFramebuffer->IsFree())
+        {
+            BindFramebuffer( pFramebuffer );
+            pFramebuffer->DetachTexture();
+        }
         pFramebuffer = pFramebuffer->mpPrevFramebuffer;
     }
 }


More information about the Libreoffice-commits mailing list