+ // Set target value into data store
+ if( animator.targetValue.GetType() != Property::NONE )
+ {
+ if( isMixColor )
+ {
+ animator.targetValue.Get( mImpl->mMixColor );
+ }
+ else
+ {
+ // Note: there may be several of these calls if more than one
+ // transform property is animated.
+ Property::Map map;
+ if( animator.propertyKey.type == Property::Key::INDEX )
+ {
+ map.Add( animator.propertyKey.indexKey, animator.targetValue );
+ }
+ else
+ {
+ map.Add( animator.propertyKey.stringKey, animator.targetValue );
+ }
+
+ mImpl->mTransform.UpdatePropertyMap( map );
+ }
+ }
+
+ if( index != Property::INVALID_INDEX )
+ {
+ SetupTransition( transition, animator, index );
+
+ // For mix color, ensure the blend mode is on if the initial or final values are not opaque,
+ // and that it is turned off after the animation ends if the final value is opaque
+ if( isMixColor && (!isMixColorOpaque || mImpl->mMixColor.a < 1.0f) )
+ {
+ mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
+
+ if( animator.animate == 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");
+ mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE,
+ ( mImpl->mMixColor.a < 1.0 ) ? BlendMode::ON : BlendMode::AUTO );
+ }
+ delete mImpl->mBlendSlotDelegate;
+ mImpl->mBlendSlotDelegate = NULL;