diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2015-11-26 12:32:08 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2015-12-03 12:28:20 +0000 |
commit | 57387eb30d07f15b1b2a798e0e4dcb0f4543945c (patch) | |
tree | 202366ffdb7b82dce497b0fa856255c79b49899e /slideshow/source/engine/slide/slideimpl.cxx | |
parent | 93122eb06abf77252f01a8a255fc28348efca911 (diff) |
tdf#96083 slide transitions wrong with appearing shapes
When using appearing animations on shapes, some of the slide transitions
incorrectly don't show these shapes. Same for disappearing shapes - both
states are wrong during slide transition time. Fix slide bitmap
generator to take final slide states into account.
Change-Id: Iea0e576009a109c7f44a7a6498b0ee5b2c4791c5
Reviewed-on: https://gerrit.libreoffice.org/20199
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'slideshow/source/engine/slide/slideimpl.cxx')
-rw-r--r-- | slideshow/source/engine/slide/slideimpl.cxx | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 690977ed5c5d..45c98551b0e6 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -157,6 +157,11 @@ private: /// Set all Shapes to their initial attributes for slideshow bool applyInitialShapeAttributes( const css::uno::Reference< css::animations::XAnimationNode >& xRootAnimationNode ); + /// Set shapes to attributes corresponding to initial or final state of slide + void applyShapeAttributes( + const css::uno::Reference< css::animations::XAnimationNode >& xRootAnimationNode, + bool bInitial) const; + /// Renders current slide content to bitmap SlideBitmapSharedPtr createCurrentSlideBitmap( const UnoViewSharedPtr& rView, @@ -272,8 +277,11 @@ private: /// When true, show() was called. Slide hidden oherwise. bool mbActive; - ///When true, enablePaintOverlay was called and mbUserPaintOverlay = true + /// When true, enablePaintOverlay was called and mbUserPaintOverlay = true bool mbPaintOverlayActive; + + /// When true, final state attributes are already applied to shapes + bool mbFinalStateApplied; }; @@ -369,7 +377,8 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra mbHaveAnimations( false ), mbMainSequenceFound( false ), mbActive( false ), - mbPaintOverlayActive( false ) + mbPaintOverlayActive( false ), + mbFinalStateApplied( false ) { // clone already existing views for slide bitmaps for( const auto& rView : rViewContainer ) @@ -523,8 +532,6 @@ void SlideImpl::hide() // vanish from view resetCursor(); mbActive = false; - - } basegfx::B2ISize SlideImpl::getSlideSize() const @@ -680,6 +687,14 @@ SlideBitmapSharedPtr SlideImpl::createCurrentSlideBitmap( const UnoViewSharedPtr ENSURE_OR_THROW( mbShowLoaded, "SlideImpl::createCurrentSlideBitmap(): No show loaded" ); + // tdf#96083 ensure end state settings are applied to shapes once when bitmap gets re-rendered + // in that state + if(!mbFinalStateApplied && FINAL_STATE == meAnimationState && mxRootNode.is()) + { + const_cast< SlideImpl* >(this)->mbFinalStateApplied = true; + applyShapeAttributes(mxRootNode, false); + } + ::cppcanvas::CanvasSharedPtr pCanvas( rView->getCanvas() ); // create a bitmap of appropriate size @@ -887,22 +902,12 @@ void SlideImpl::startIntrinsicAnimations() mpSubsettableShapeManager->notifyIntrinsicAnimationsEnabled(); } -bool SlideImpl::applyInitialShapeAttributes( - const uno::Reference< animations::XAnimationNode >& xRootAnimationNode ) +void SlideImpl::applyShapeAttributes( + const css::uno::Reference< css::animations::XAnimationNode >& xRootAnimationNode, + bool bInitial) const { - if( !implPrefetchShow() ) - return false; - - if( !xRootAnimationNode.is() ) - { - meAnimationState = INITIAL_STATE; - - return true; // no animations - no attributes to apply - - // succeeded - } - uno::Sequence< animations::TargetProperties > aProps( - TargetPropertiesCreator::createInitialTargetProperties( xRootAnimationNode ) ); + TargetPropertiesCreator::createTargetProperties( xRootAnimationNode, bInitial ) ); // apply extracted values to our shapes const ::std::size_t nSize( aProps.getLength() ); @@ -994,6 +999,23 @@ bool SlideImpl::applyInitialShapeAttributes( } } } +} + +bool SlideImpl::applyInitialShapeAttributes( + const uno::Reference< animations::XAnimationNode >& xRootAnimationNode ) +{ + if( !implPrefetchShow() ) + return false; + + if( !xRootAnimationNode.is() ) + { + meAnimationState = INITIAL_STATE; + + return true; // no animations - no attributes to apply - + // succeeded + } + + applyShapeAttributes(xRootAnimationNode, true); meAnimationState = INITIAL_STATE; |