Kaydet (Commit) 6b443b08 authored tarafından Michael Meeks's avatar Michael Meeks

vcl: use a custom tag for VCL OpenGLContext's to avoid re-use.

Other code is out of legacy mode now, so can't legacy as a proxy.

Change-Id: Ie3807a3af680b707f2f08d058db955bc9cae6c2b
Reviewed-on: https://gerrit.libreoffice.org/20647Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 166b7ef4
......@@ -204,6 +204,10 @@ public:
return mbRequestLegacyContext;
}
/// VCL promiscuously re-uses its own contexts:
void setVCLOnly() { mbVCLOnly = true; }
bool isVCLOnly() { return mbVCLOnly; }
bool supportMultiSampling() const;
static SystemWindowData generateWinData(vcl::Window* pParent, bool bRequestLegacyContext);
......@@ -229,6 +233,7 @@ private:
int mnRefCount;
bool mbRequestLegacyContext;
bool mbUseDoubleBufferedRendering;
bool mbVCLOnly;
int mnFramebufferCount;
OpenGLFramebuffer* mpCurrentFramebuffer;
......
......@@ -72,9 +72,6 @@ protected:
OpenGLFramebuffer* mpFramebuffer;
OpenGLProgram* mpProgram;
/// Is it someone else's context we shouldn't be fiddling with ?
static bool IsForeignContext(const rtl::Reference<OpenGLContext> &xContext);
/// This idle handler is used to swap buffers after rendering.
OpenGLFlushIdle *mpFlush;
......@@ -174,7 +171,7 @@ protected:
bool UseContext( const rtl::Reference<OpenGLContext> &pContext )
{
return pContext->isInitialized() && // not released by the OS etc.
IsForeignContext( pContext ); // a genuine VCL context.
pContext->isVCLOnly();
}
public:
......
......@@ -2092,11 +2092,4 @@ void OpenGLSalGraphicsImpl::doFlush()
VCL_GL_INFO( "flushAndSwap - end." );
}
bool OpenGLSalGraphicsImpl::IsForeignContext(const rtl::Reference<OpenGLContext> &xContext)
{
// so far a blunt heuristic: vcl uses shiny new contexts.
return xContext->requestedLegacy();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -29,6 +29,7 @@ void WinOpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics*
rtl::Reference<OpenGLContext> WinOpenGLSalGraphicsImpl::CreateWinContext()
{
rtl::Reference<OpenGLContext> pContext = OpenGLContext::Create();
pContext->setVCLOnly();
pContext->init( mrParent.mhLocalDC, mrParent.mhWnd );
return pContext;
}
......
......@@ -53,6 +53,7 @@ rtl::Reference<OpenGLContext> X11OpenGLSalGraphicsImpl::CreateWinContext()
Window aWin = pProvider->GetX11Window();
rtl::Reference<OpenGLContext> pContext = OpenGLContext::Create();
pContext->setVCLOnly();
pContext->init( mrParent.GetXDisplay(), aWin,
mrParent.m_nXScreen.getXScreen() );
return pContext;
......
......@@ -62,6 +62,7 @@ OpenGLContext::OpenGLContext():
mnRefCount(0),
mbRequestLegacyContext(false),
mbUseDoubleBufferedRendering(true),
mbVCLOnly(false),
mnFramebufferCount(0),
mpCurrentFramebuffer(nullptr),
mpFirstFramebuffer(nullptr),
......
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