diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-09-07 22:21:15 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-09-18 10:10:32 +0200 |
commit | c47852b6d712cce69dab653547e9121682635540 (patch) | |
tree | 800af0a157d0612ccbf33f2252635470c5f5d84d /slideshow | |
parent | 38c9eb0dde2916e37d0c7638c83efa6b2e510003 (diff) |
tdf#94006 - re-factor and fix OpenGLContext mis-use.
Squashes two related patches from master:
Don't use rtl::Reference for the global / list state, so the
ref-count reflects the number of real users.
Hold a reference during ~OpenGLContext.
Fix mis-use in:
gltf rendering, OpenGL canvas, GL transitions & GL capable (charts)
Avoid GLX operations on un-initialized contexts.
Signed-off-by: Miklos Vajna <vmiklos@collabora.co.uk>
Conflicts:
vcl/source/opengl/OpenGLContext.cxx
vcl/workben/vcldemo.cxx
canvas/source/opengl/ogl_spritedevicehelper.hxx
Change-Id: I7ea29b544d53bb80b25fa6663d39f345bf8f4e64
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx index 50a89061af9a..9f2b60b6649d 100644 --- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx +++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx @@ -228,7 +228,7 @@ private: void impl_finishTransition(); private: - boost::shared_ptr<OpenGLContext> mpContext; + rtl::Reference<OpenGLContext> mpContext; /** OpenGL handle to the leaving slide's texture */ @@ -368,7 +368,7 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta sal_Int64 aVal = 0; aDeviceParams[1] >>= aVal; - mpContext = boost::make_shared<OpenGLContext>(); + mpContext = OpenGLContext::Create(); mpContext->requestLegacyContext(); if( !mpContext->init( reinterpret_cast< vcl::Window* >( aVal ) ) ) @@ -1323,7 +1323,7 @@ void OGLTransitionerImpl::impl_dispose() { impl_finishTransition(); disposeTextures(); - mpContext.reset(); + mpContext.clear(); } // we are about to be disposed (someone call dispose() on us) @@ -1350,7 +1350,7 @@ void OGLTransitionerImpl::disposing() #endif #if defined( UNX ) && !defined( MACOSX ) - if( mbRestoreSync && bool(mpContext) ) { + if( mbRestoreSync && bool(mpContext.is()) ) { // try to reestablish synchronize state char* sal_synchronize = getenv("SAL_SYNCHRONIZE"); XSynchronize( mpContext->getOpenGLWindow().dpy, sal_synchronize && *sal_synchronize == '1' ); |