diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-11-16 13:42:28 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-12-04 01:53:21 +0000 |
commit | c09b1806bc7700036558c7e986bcddd34da314dd (patch) | |
tree | 5c4c8e50465ba73e02bec0002563e2836cfe7496 | |
parent | More debugging work; potentially multiple contexts created for same window. (diff) | |
download | core-c09b1806bc7700036558c7e986bcddd34da314dd.tar.gz core-c09b1806bc7700036558c7e986bcddd34da314dd.zip |
Try to de-bong horrors around vdev creation.
This used to create multiple GL Contexts' for the same drawable [!]
And then release them again, etc. a flicker frenzy for vdevs.
Change-Id: Ia2d79fea3db6ded75e278b8dda80da7d91186c8e
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 17 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/gtk/gtkinst.cxx | 2 |
3 files changed, 18 insertions, 6 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index f95b98f3a6f9..cd5c1a8300f0 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -121,6 +121,11 @@ bool OpenGLSalGraphicsImpl::ReleaseContext() void OpenGLSalGraphicsImpl::Init() { + // Our init phase is strange ::Init is called twice for vdevs. + // the first time around with a NULL geometry provider. + if( !mpProvider ) + return; + // check if we can simply re-use the same context if( mpContext.is() ) { @@ -142,11 +147,12 @@ void OpenGLSalGraphicsImpl::Init() VCL_GL_INFO("vcl.opengl", "::Init - re-size offscreen texture"); } - if( mpWindowContext.is() ) - mpWindowContext->reset(); - if( !IsOffscreen() ) + { + if( mpWindowContext.is() ) + mpWindowContext->reset(); mpWindowContext = CreateWinContext(); + } } // Currently only used to get windows ordering right. @@ -208,6 +214,11 @@ void OpenGLSalGraphicsImpl::PostDraw() assert (maOffscreenTex); + if( IsOffscreen() ) + assert( !mpWindowContext.is() ); + else + assert( mpWindowContext.is() ); + if( mpContext->mnPainting == 0 ) { if (!IsOffscreen()) diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index abcf6351c87a..1241439cbcd2 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -156,6 +156,7 @@ void X11SalGraphics::SetDrawable( Drawable aDrawable, SalX11Screen nXScreen ) // TODO: moggi: FIXME nTextPixel_ = GetPixel( nTextColor_ ); } +// Initialize the SalGraphics, if @pFrame is NULL - this is a vdev. void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, SalX11Screen nXScreen ) { @@ -165,8 +166,8 @@ void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, m_pFrame = pFrame; m_pVDev = nullptr; - bWindow_ = true; - bVirDev_ = false; + bWindow_ = pFrame; + bVirDev_ = !pFrame; SetDrawable( aTarget, nXScreen ); mxImpl->Init(); diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx index 7ae75c43f963..d03baf9bf8fe 100644 --- a/vcl/unx/gtk/gtkinst.cxx +++ b/vcl/unx/gtk/gtkinst.cxx @@ -328,7 +328,7 @@ SalVirtualDevice* GtkInstance::CreateVirtualDevice( SalGraphics *pG, GtkSalGraphics *pGtkSalGraphics = dynamic_cast<GtkSalGraphics*>(pG); assert(pGtkSalGraphics); return CreateX11VirtualDevice(pG, nDX, nDY, eFormat, pGd, - new GtkSalGraphics(pGtkSalGraphics->GetGtkFrame(), pGtkSalGraphics->GetGtkWidget())); + new GtkSalGraphics(NULL, pGtkSalGraphics->GetGtkWidget())); #endif } |