/*
- * 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.
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 );
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 );
}
{
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 );
}
{
// 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 )
{
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;