diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-09-16 03:25:05 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-09-16 03:25:57 +0100 |
commit | dd0fa60f6c289d7f290577cc240deb7b6e83fc8f (patch) | |
tree | 468e62bcd7ffdad840905a6df5234ff26acd5a6a /vcl/opengl/gdiimpl.cxx | |
parent | 625d83e430a4caf35675d2900c11ab6929a8304a (diff) |
tdf#94252 - avoid switching contexts un-necessarily to reduce flicker.
Change-Id: Id4ac387174fa03c5886a990d89fd53a4f18db11c
Diffstat (limited to 'vcl/opengl/gdiimpl.cxx')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 943e1b43fe21..c092f0317b1b 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -77,8 +77,17 @@ bool OpenGLSalGraphicsImpl::AcquireContext( ) { ImplSVData* pSVData = ImplGetSVData(); + // We always prefer to bind our VirtualDevice / offscreen graphics + // to the current OpenGLContext - to avoid switching contexts. + if (mpContext.is() && mbOffscreen) + { + if (OpenGLContext::hasCurrent() && !mpContext->isCurrent()) + mpContext.clear(); + } + if( mpContext.is() ) { + // Check whether the context was reset underneath us. if( mpContext->isInitialized() ) return true; mpContext.clear(); |