Kaydet (Commit) 4c424d78 authored tarafından Louis-Francis Ratté-Boulianne's avatar Louis-Francis Ratté-Boulianne Kaydeden (comit) Markus Mohrhard

vcl: Keep the same context for VirtualDevice to avoid FBO switches

Change-Id: I66496fae902db9df5b8301b00bb779f42adaa7a7
üst 2e512773
......@@ -56,8 +56,8 @@ OpenGLSalGraphicsImpl::~OpenGLSalGraphicsImpl()
OpenGLContext* OpenGLSalGraphicsImpl::GetOpenGLContext()
{
if( !mpContext )
AcquireContext();
if( !AcquireContext() )
return NULL;
return mpContext;
}
......@@ -71,7 +71,11 @@ bool OpenGLSalGraphicsImpl::AcquireContext( )
ImplSVData* pSVData = ImplGetSVData();
if( mpContext )
{
if( mpContext->isInitialized() )
return true;
mpContext->DeRef();
}
OpenGLContext* pContext = pSVData->maGDIData.mpLastContext;
......@@ -122,7 +126,7 @@ void OpenGLSalGraphicsImpl::Init()
void OpenGLSalGraphicsImpl::PreDraw()
{
if( !mpContext && !AcquireContext() )
if( !AcquireContext() )
{
SAL_WARN( "vcl.opengl", "Couldn't acquire context" );
return;
......@@ -161,11 +165,6 @@ void OpenGLSalGraphicsImpl::PostDraw()
mpFramebuffer = NULL;
CHECK_GL_ERROR();
// release the context as there is no guarantee the underlying window
// will still be valid for the next draw operation
if( mbOffscreen )
ReleaseContext();
}
void OpenGLSalGraphicsImpl::freeResources()
......@@ -1414,7 +1413,7 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPoly,
void OpenGLSalGraphicsImpl::beginPaint()
{
if( !mpContext && !AcquireContext() )
if( !AcquireContext() )
return;
mpContext->mnPainting++;
......@@ -1422,7 +1421,7 @@ void OpenGLSalGraphicsImpl::beginPaint()
void OpenGLSalGraphicsImpl::endPaint()
{
if( !mpContext && !AcquireContext() )
if( !AcquireContext() )
return;
mpContext->mnPainting--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment