diff options
Diffstat (limited to 'slideshow/source/engine/opengl')
-rw-r--r-- | slideshow/source/engine/opengl/TransitionImpl.cxx | 25 | ||||
-rw-r--r-- | slideshow/source/engine/opengl/TransitionImpl.hxx | 3 | ||||
-rw-r--r-- | slideshow/source/engine/opengl/TransitionerImpl.cxx | 3 |
3 files changed, 18 insertions, 13 deletions
diff --git a/slideshow/source/engine/opengl/TransitionImpl.cxx b/slideshow/source/engine/opengl/TransitionImpl.cxx index d1926ab854f9..98d6778fd197 100644 --- a/slideshow/source/engine/opengl/TransitionImpl.cxx +++ b/slideshow/source/engine/opengl/TransitionImpl.cxx @@ -1351,37 +1351,40 @@ std::shared_ptr<OGLTransitionImpl> makeFadeSmoothly() namespace { -class FadeThroughBlackTransition : public OGLTransitionImpl +class FadeThroughColorTransition : public OGLTransitionImpl { public: - FadeThroughBlackTransition(const TransitionScene& rScene, const TransitionSettings& rSettings) - : OGLTransitionImpl(rScene, rSettings) + FadeThroughColorTransition(const TransitionScene& rScene, const TransitionSettings& rSettings, bool white) + : OGLTransitionImpl(rScene, rSettings), useWhite( white ) {} private: virtual GLuint makeShader() const override; + bool useWhite; }; -GLuint FadeThroughBlackTransition::makeShader() const +GLuint FadeThroughColorTransition::makeShader() const { - return OpenGLHelper::LoadShaders( "basicVertexShader", "fadeBlackFragmentShader" ); + return OpenGLHelper::LoadShaders( "basicVertexShader", "fadeBlackFragmentShader", + useWhite ? "#define use_white" : "", "" ); } std::shared_ptr<OGLTransitionImpl> -makeFadeThroughBlackTransition( +makeFadeThroughColorTransition( const Primitives_t& rLeavingSlidePrimitives, const Primitives_t& rEnteringSlidePrimitives, - const TransitionSettings& rSettings) + const TransitionSettings& rSettings, + bool white) { - return std::make_shared<FadeThroughBlackTransition>( + return std::make_shared<FadeThroughColorTransition>( TransitionScene(rLeavingSlidePrimitives, rEnteringSlidePrimitives), - rSettings) + rSettings, white) ; } } -std::shared_ptr<OGLTransitionImpl> makeFadeThroughBlack() +std::shared_ptr<OGLTransitionImpl> makeFadeThroughColor( bool white ) { Primitive Slide; @@ -1395,7 +1398,7 @@ std::shared_ptr<OGLTransitionImpl> makeFadeThroughBlack() TransitionSettings aSettings; aSettings.mbUseMipMapLeaving = aSettings.mbUseMipMapEntering = false; - return makeFadeThroughBlackTransition(aLeavingSlide, aEnteringSlide, aSettings); + return makeFadeThroughColorTransition(aLeavingSlide, aEnteringSlide, aSettings, white); } namespace diff --git a/slideshow/source/engine/opengl/TransitionImpl.hxx b/slideshow/source/engine/opengl/TransitionImpl.hxx index 2831685cd3a7..ca1d36366a6c 100644 --- a/slideshow/source/engine/opengl/TransitionImpl.hxx +++ b/slideshow/source/engine/opengl/TransitionImpl.hxx @@ -271,7 +271,8 @@ std::shared_ptr<OGLTransitionImpl> makeNewsflash(); std::shared_ptr<OGLTransitionImpl> makeDiamond(); std::shared_ptr<OGLTransitionImpl> makeFadeSmoothly(); -std::shared_ptr<OGLTransitionImpl> makeFadeThroughBlack(); +// fade through black or white +std::shared_ptr<OGLTransitionImpl> makeFadeThroughColor( bool white = false ); class SceneObject { diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx b/slideshow/source/engine/opengl/TransitionerImpl.cxx index 7403cad87425..c60be299752a 100644 --- a/slideshow/source/engine/opengl/TransitionerImpl.cxx +++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx @@ -1214,6 +1214,7 @@ public: virtual uno::Reference< presentation::XTransition > SAL_CALL createTransition( sal_Int16 transitionType, sal_Int16 transitionSubType, + sal_Int32 transitionFadeColor, const uno::Reference< presentation::XSlideShowView >& view, const uno::Reference< rendering::XBitmap >& leavingBitmap, const uno::Reference< rendering::XBitmap >& enteringBitmap ) override @@ -1288,7 +1289,7 @@ public: } else if( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::CROSSFADE ) { pTransition = makeFadeSmoothly(); } else if( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::FADEOVERCOLOR ) { - pTransition = makeFadeThroughBlack(); + pTransition = makeFadeThroughColor( transitionFadeColor == 0xffffff ); } else if( transitionType == animations::TransitionType::IRISWIPE && transitionSubType == animations::TransitionSubType::DIAMOND ) { pTransition = makeDiamond(); } else if( transitionType == animations::TransitionType::ZOOM && transitionSubType == animations::TransitionSubType::ROTATEIN ) { |