summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/gdiimpl.cxx16
-rw-r--r--vcl/opengl/win/gdiimpl.cxx11
-rw-r--r--vcl/opengl/x11/gdiimpl.cxx10
3 files changed, 8 insertions, 29 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 970957cf1555..e836e821f82f 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -61,6 +61,11 @@ OpenGLContext* OpenGLSalGraphicsImpl::GetOpenGLContext()
return mpContext;
}
+OpenGLContext* OpenGLSalGraphicsImpl::GetDefaultContext()
+{
+ return ImplGetDefaultWindow()->GetGraphics()->GetOpenGLContext();
+}
+
bool OpenGLSalGraphicsImpl::AcquireContext( )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -81,7 +86,7 @@ bool OpenGLSalGraphicsImpl::AcquireContext( )
if( pContext )
pContext->AddRef();
else
- pContext = mbOffscreen ? CreatePixmapContext() : CreateWinContext();
+ pContext = mbOffscreen ? GetDefaultContext() : CreateWinContext();
mpContext = pContext;
return (mpContext != NULL);
@@ -112,15 +117,6 @@ void OpenGLSalGraphicsImpl::Init()
maOffscreenTex.GetHeight() != GetHeight() )
{
maOffscreenTex = OpenGLTexture();
-#if defined(WNT)
- // URGH ... VirtualDevice may have destroyed the underlying resource
- // our context is associated with - FIXME: can we do better here ?
- if (mpContext)
- {
- mpContext->resetToReInitialize();
- ReleaseContext();
- }
-#endif
}
}
diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx
index 939d4e0a1c50..a56ea3063b14 100644
--- a/vcl/opengl/win/gdiimpl.cxx
+++ b/vcl/opengl/win/gdiimpl.cxx
@@ -38,16 +38,9 @@ bool WinOpenGLSalGraphicsImpl::UseContext( OpenGLContext* pContext )
{
if( !pContext || !pContext->isInitialized() )
return false;
+ if( IsOffscreen() )
+ return true;
return ( pContext->getOpenGLWindow().hWnd == mrParent.mhWnd );
}
-OpenGLContext* WinOpenGLSalGraphicsImpl::CreatePixmapContext()
-{
- OpenGLContext* pContext = new OpenGLContext();
- pContext->requestVirtualDevice();
- pContext->requestSingleBufferedRendering();
- pContext->init( mrParent.mhLocalDC, mrParent.mhWnd );
- return pContext;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index e5070d7b02c7..d0d890b97fc6 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -56,16 +56,6 @@ OpenGLContext* X11OpenGLSalGraphicsImpl::CreateWinContext()
return pContext;
}
-OpenGLContext* X11OpenGLSalGraphicsImpl::CreatePixmapContext()
-{
- X11OpenGLSalVirtualDevice* pVDev = dynamic_cast<X11OpenGLSalVirtualDevice*>(mrParent.m_pVDev);
-
- if( pVDev == NULL )
- return NULL;
-
- return ImplGetDefaultWindow()->GetGraphics()->GetOpenGLContext();
-}
-
bool X11OpenGLSalGraphicsImpl::UseContext( OpenGLContext* pContext )
{
X11WindowProvider *pProvider = dynamic_cast<X11WindowProvider*>(mrParent.m_pFrame);