summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-13 18:09:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-06-13 22:06:04 +0200
commit277395b6266c57a7709c3c47986f135f6789c8e7 (patch)
treef2435b78c0f27658e67f9219dc56de070da2b0aa /slideshow
parent60763a9551bea003271de9307923327e7a39b63e (diff)
make opengl transitions under X flicker free on enter/leave
Change-Id: I109637dc6b3d23c0beca21f3cf0c7ba918ecb4f8 Reviewed-on: https://gerrit.libreoffice.org/38749 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.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index b19d62973108..68d50b9b03f3 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);
+ }
}