summaryrefslogtreecommitdiff
path: root/vcl/opengl/x11
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-09-07 22:21:15 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-09-08 13:04:02 +0100
commit2456cf8306be22e32130e789ab939c059e5e79e5 (patch)
treed188be461e188023fd4da0690e6278e76e596c2d /vcl/opengl/x11
parent64c6b0ed6c67d169021732d276ec02706e139261 (diff)
tdf#94006 - re-factor to use rtl::Reference for OpenGLContexts.
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. Change-Id: I4e57a7246159acd58ae7d5a0dfc8704b9795c894
Diffstat (limited to 'vcl/opengl/x11')
-rw-r--r--vcl/opengl/x11/gdiimpl.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index 4c592842d9d8..65b279b43f11 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -44,7 +44,7 @@ void X11OpenGLSalGraphicsImpl::Init()
OpenGLSalGraphicsImpl::Init();
}
-OpenGLContext* X11OpenGLSalGraphicsImpl::CreateWinContext()
+rtl::Reference<OpenGLContext> X11OpenGLSalGraphicsImpl::CreateWinContext()
{
X11WindowProvider *pProvider = dynamic_cast<X11WindowProvider*>(mrParent.m_pFrame);
@@ -52,13 +52,13 @@ OpenGLContext* X11OpenGLSalGraphicsImpl::CreateWinContext()
return NULL;
Window aWin = pProvider->GetX11Window();
- OpenGLContext* pContext = new OpenGLContext();
+ rtl::Reference<OpenGLContext> pContext = OpenGLContext::Create();
pContext->init( mrParent.GetXDisplay(), aWin,
mrParent.m_nXScreen.getXScreen() );
return pContext;
}
-bool X11OpenGLSalGraphicsImpl::UseContext( OpenGLContext* pContext )
+bool X11OpenGLSalGraphicsImpl::UseContext( const rtl::Reference<OpenGLContext> &pContext )
{
X11WindowProvider *pProvider = dynamic_cast<X11WindowProvider*>(mrParent.m_pFrame);
@@ -66,9 +66,9 @@ bool X11OpenGLSalGraphicsImpl::UseContext( OpenGLContext* pContext )
return false;
if( !pProvider )
- return ( pContext->getOpenGLWindow().win != None );
+ return pContext->getOpenGLWindow().win != None;
else
- return ( pContext->getOpenGLWindow().win == pProvider->GetX11Window() );
+ return pContext->getOpenGLWindow().win == pProvider->GetX11Window();
}
void X11OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics )