summaryrefslogtreecommitdiff
path: root/vcl/opengl/gdiimpl.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-09-01 15:09:25 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-09-01 15:16:08 +0100
commit6a12aecf6f7791f00894b08bb394ee0139e10d6f (patch)
treef85f363162ab3da63ce35d7e07dfeb9536f98f5b /vcl/opengl/gdiimpl.cxx
parent34ebb26d4c63d73d42d711c9a6e09aae9afae61e (diff)
tdf#93839 - Encourage vdevs to pick up new GL Contexts when they go invalid.
Change-Id: I21726d0dd052fdc87e8dd36ff7122518325f6313
Diffstat (limited to 'vcl/opengl/gdiimpl.cxx')
-rw-r--r--vcl/opengl/gdiimpl.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index c16b93bfe1a1..a1508f37cd9b 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -149,6 +149,19 @@ void OpenGLSalGraphicsImpl::Init()
}
}
+// Currently only used to get windows ordering right.
+void OpenGLSalGraphicsImpl::DeInit()
+{
+ // tdf#93839:
+ // Our window handles and resources are being free underneath us.
+ // These can be bound into a context, which relies on them. So
+ // let it know. Other eg. VirtualDevice contexts which have
+ // references on and rely on this context continuing to work will
+ // get a shiny new context in AcquireContext:: next PreDraw.
+ if( mpContext && !IsOffscreen() )
+ mpContext->reset();
+}
+
void OpenGLSalGraphicsImpl::PreDraw()
{
OpenGLZone::enter();