vcl/opengl/gdiimpl.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 3891bd40f6cf513a020ac6c87acfd0af7fc5ffd8
Author: Michael Meeks <michael.me...@collabora.com>
Date:   Wed Sep 16 03:25:05 2015 +0100

    tdf#94252 - avoid switching contexts un-necessarily to reduce flicker.
    
    Change-Id: Id4ac387174fa03c5886a990d89fd53a4f18db11c
    Reviewed-on: https://gerrit.libreoffice.org/18610
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 37b21f3..9ea8a7c 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -77,8 +77,17 @@ bool OpenGLSalGraphicsImpl::AcquireContext( )
 {
     ImplSVData* pSVData = ImplGetSVData();
 
+    // We always prefer to bind our VirtualDevice / offscreen graphics
+    // to the current OpenGLContext - to avoid switching contexts.
+    if (mpContext.is() && mbOffscreen)
+    {
+        if (OpenGLContext::hasCurrent() && !mpContext->isCurrent())
+            mpContext.clear();
+    }
+
     if( mpContext.is() )
     {
+        // Check whether the context was reset underneath us.
         if( mpContext->isInitialized() )
             return true;
         mpContext.clear();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to