[Libreoffice-commits] core.git: vcl/inc vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Nov 29 14:28:35 UTC 2016


 vcl/inc/opengl/RenderState.hxx      |    2 +-
 vcl/source/opengl/OpenGLContext.cxx |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 58a6cbfbf309b151b9d1463c734343430f9a1220
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Sun Nov 27 22:51:39 2016 +0100

    tdf#104139 state can't be set as context may not be available
    
    When RenderState is constructed (and all capability states get
    constructed) the OpenGL context may not be available yet, so we
    just set the state to whatever value (false) and make sure we sync
    with the actual state right away when we have OpenGL context set
    up and ready.
    
    Change-Id: I65a669ab76c1834775007d62efe3d6ac061d6f21
    Reviewed-on: https://gerrit.libreoffice.org/31278
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/vcl/inc/opengl/RenderState.hxx b/vcl/inc/opengl/RenderState.hxx
index 25dd837..b7b2f18 100644
--- a/vcl/inc/opengl/RenderState.hxx
+++ b/vcl/inc/opengl/RenderState.hxx
@@ -20,7 +20,7 @@ protected:
     bool mbTest;
 
     GenericCapabilityState()
-        : mbTest(readState())
+        : mbTest(false)
     {
     }
 
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index f681dc2..93bde70 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -568,6 +568,9 @@ void OpenGLContext::registerAsCurrent()
         pSVData->maGDIData.mpLastContext->mpNextContext = this;
         pSVData->maGDIData.mpLastContext = this;
     }
+
+    // sync the render state with the current context
+    mpRenderState->sync();
 }
 
 void OpenGLContext::resetCurrent()


More information about the Libreoffice-commits mailing list