- SetupBlendMode( transition, isOpaque, animator.animate );
- }
- }
-}
-
-void Visual::Base::SetupBlendMode( Animation& transition, bool isInitialOpaque, bool animating )
-{
- // Ensure the blend mode is turned on if we are animating opacity, and
- // turned off after the animation ends if the final value is opaque
- if( ( ! isInitialOpaque || mImpl->mMixColor.a < 1.0f ) ||
- ( mImpl->mRenderer && IsAdvancedBlendEquationApplied() ) )
- {
- if( mImpl->mRenderer )
- {
- mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
-
- if( animating == true && mImpl->mMixColor.a >= 1.0f )
- {
- // When it becomes opaque, set the blend mode back to automatically
- if( ! mImpl->mBlendSlotDelegate )
- {
- mImpl->mBlendSlotDelegate = new SlotDelegate<Visual::Base>(this);
- }
- transition.FinishedSignal().Connect( *(mImpl->mBlendSlotDelegate),
- &Visual::Base::OnMixColorFinished );
- }
- }
- }
-}
-
-void Visual::Base::OnMixColorFinished( Animation& animation )
-{
- if( mImpl->mRenderer )
- {
- DALI_LOG_INFO( gVisualBaseLogFilter, Debug::General, "Visual::Base::OnMixColorFinished()\n");
-
- if( mImpl->mMixColor.a >= 1.f &&
- !IsAdvancedBlendEquationApplied() )
- {
- mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO );
- }
- else
- {
- mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );