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 15:29:06 +0100
commit959bf134acb2782f4bf2ab299a96581e016ebc3d (patch)
tree5c7631d52ec20abe210dc75d2ffeea98f832797c
parent8114a779143a7f0042d7e15b476037315ed2b4c3 (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> (cherry picked from commit 58a6cbfbf309b151b9d1463c734343430f9a1220) Signed-off-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 979e2bf32a98..33d80095b15c 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()