X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-base-impl.cpp;h=748bcec94ff372942137fedc82180eb13a564874;hp=885bc72a3a1421e5fe6715ff44b11515ec01226b;hb=b86fa7f2bedebe580b0e9a20f9b42cf2d628fafa;hpb=a2c786a79c7565ff506ac0a546910fbeb8371ec8;ds=sidebyside diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index 885bc72..748bcec 100755 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -413,6 +413,11 @@ bool Visual::Base::IsPreMultipliedAlphaEnabled() const return mImpl->mFlags & Impl::IS_PREMULTIPLIED_ALPHA; } +bool Visual::Base::IsAdvancedBlendEquationApplied() const +{ + return IsPreMultipliedAlphaEnabled() && DevelRenderer::IsAdvancedBlendEquationApplied( mImpl->mRenderer ); +} + void Visual::Base::DoSetOffScene( Actor& actor ) { actor.RemoveRenderer( mImpl->mRenderer ); @@ -446,7 +451,7 @@ void Visual::Base::RegisterMixColor() Vector3(mImpl->mMixColor) ); } - if( mImpl->mMixColor.a < 1.f ) + if( mImpl->mMixColor.a < 1.f || IsAdvancedBlendEquationApplied() ) { mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON ); } @@ -469,7 +474,7 @@ void Visual::Base::SetMixColor( const Vector4& color ) { mImpl->mRenderer.SetProperty( mImpl->mMixColorIndex, Vector3(color) ); mImpl->mRenderer.SetProperty( DevelRenderer::Property::OPACITY, color.a ); - if( color.a < 1.f ) + if( color.a < 1.f || IsAdvancedBlendEquationApplied() ) { mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON ); } @@ -770,7 +775,8 @@ void Visual::Base::SetupBlendMode( Animation& transition, bool isInitialOpaque, { // 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 ) + if( ( ! isInitialOpaque || mImpl->mMixColor.a < 1.0f ) || + ( mImpl->mRenderer && IsAdvancedBlendEquationApplied() ) ) { if( mImpl->mRenderer ) { @@ -795,8 +801,16 @@ 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 ); + + 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 ); + } } delete mImpl->mBlendSlotDelegate; mImpl->mBlendSlotDelegate = NULL;