diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-13 18:09:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-06-14 16:09:45 +0200 |
commit | dc22d67525d31c8ebdb2563f3d56e6e5b9f7745b (patch) | |
tree | 4877405d30ebdb1e6c4f457076de01d86746874c /slideshow | |
parent | 5649def882dfd00bd9e7f8d9d079955daf80bebb (diff) |
make opengl transitions under X flicker free on enter/leave
Change-Id: I109637dc6b3d23c0beca21f3cf0c7ba918ecb4f8
Reviewed-on: https://gerrit.libreoffice.org/38752
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/opengl/TransitionerImpl.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx b/slideshow/source/engine/opengl/TransitionerImpl.cxx index 644c3b823498..246f9c85cb09 100644 --- a/slideshow/source/engine/opengl/TransitionerImpl.cxx +++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx @@ -365,6 +365,26 @@ void OGLTransitionerImpl::setSlides( const uno::Reference< rendering::XBitmap >& SAL_INFO("slideshow.opengl", "leaving bitmap area: " << maSlideSize.Width << "x" << maSlideSize.Height); maSlideSize = mxEnteringBitmap->getSize(); SAL_INFO("slideshow.opengl", "entering bitmap area: " << maSlideSize.Width << "x" << maSlideSize.Height); + + //to avoid annoying flashing under X entering and leaving slides with opengl effects set the leaving + //bitmap as the background pixmap of the opengl child window and the entering bitmap as the background + //pixmap of the non-opengl parent window. If any expose events occur around the start and end of + //the transition then those windows are default filled by X with the desired start/end image so there's + //no visible flash + if (SystemChildWindow* pChildWindow = mpContext->getChildWindow()) + { + css::uno::Reference<css::beans::XFastPropertySet> xEnteringFastPropertySet(mxEnteringBitmap, css::uno::UNO_QUERY); + css::uno::Reference<css::beans::XFastPropertySet> xLeavingFastPropertySet(mxLeavingBitmap, css::uno::UNO_QUERY); + css::uno::Sequence<css::uno::Any> aEnteringBitmap; + css::uno::Sequence<css::uno::Any> aLeavingBitmap; + if (xEnteringFastPropertySet.get() && xLeavingFastPropertySet.get()) + { + xEnteringFastPropertySet->getFastPropertyValue(1) >>= aEnteringBitmap; + xLeavingFastPropertySet->getFastPropertyValue(1) >>= aLeavingBitmap; + } + if (aEnteringBitmap.getLength() == 3 && aLeavingBitmap.getLength() == 3) + pChildWindow->SetLeaveEnterBackgrounds(aLeavingBitmap, aEnteringBitmap); + } } |