summaryrefslogtreecommitdiff
path: root/vcl/opengl/salbmp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/opengl/salbmp.cxx')
-rw-r--r--vcl/opengl/salbmp.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 05a55d7d504e..f3f131bb2075 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -595,7 +595,7 @@ void OpenGLSalBitmap::updateChecksum() const
OpenGLSalBitmap* pThis = const_cast<OpenGLSalBitmap*>(this);
- if (!mpContext)
+ if (!mpContext.is())
{
pThis->CreateTexture();
}
@@ -614,7 +614,7 @@ void OpenGLSalBitmap::updateChecksum() const
}
}
-OpenGLContext* OpenGLSalBitmap::GetBitmapContext()
+rtl::Reference<OpenGLContext> OpenGLSalBitmap::GetBitmapContext()
{
return ImplGetDefaultWindow()->GetGraphics()->GetOpenGLContext();
}
@@ -624,12 +624,14 @@ void OpenGLSalBitmap::makeCurrent()
ImplSVData* pSVData = ImplGetSVData();
// TODO: make sure we can really use the last used context
- mpContext = pSVData->maGDIData.mpLastContext;
- while( mpContext && !mpContext->isInitialized() )
- mpContext = mpContext->mpPrevContext;
- if( !mpContext )
+ OpenGLContext *pContext = pSVData->maGDIData.mpLastContext;
+ while( pContext && !pContext->isInitialized() )
+ pContext = pContext->mpPrevContext;
+ if( pContext )
+ mpContext = pContext;
+ else
mpContext = GetBitmapContext();
- assert(mpContext && "Couldn't get an OpenGL context");
+ assert(mpContext.is() && "Couldn't get an OpenGL context");
mpContext->makeCurrent();
}