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

New commits:
commit 959bf134acb2782f4bf2ab299a96581e016ebc3d
Author: Tomaž Vajngerl <[email protected]>
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 <[email protected]>
    Tested-by: David Tardon <[email protected]>
    (cherry picked from commit 58a6cbfbf309b151b9d1463c734343430f9a1220)
    Signed-off-by: David Tardon <[email protected]>

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 979e2bf..33d8009 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()
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to