summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-11-27 22:51:39 +0100
committerDavid Tardon <dtardon@redhat.com>2016-11-29 14:28:10 +0000
commit58a6cbfbf309b151b9d1463c734343430f9a1220 (patch)
tree67dc26e1ab74389d7fe48b7dd484846b4dabc331
parent5bf32e4e78ffbe34f3b2840a9677ded34e5b4da7 (diff)
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@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--vcl/inc/opengl/RenderState.hxx2
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx3
2 files changed, 4 insertions, 1 deletions
diff --git a/vcl/inc/opengl/RenderState.hxx b/vcl/inc/opengl/RenderState.hxx
index 25dd8377e81c..b7b2f18a692b 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 f681dc21a4ec..93bde70bcdf7 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()