/*
- * Copyright (c) 2019 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.
DepthFunction::Type depthFunction,
StencilParameters& stencilParameters )
: mRenderDataProvider( dataProvider ),
- mContext( NULL),
+ mContext( nullptr),
mGeometry( geometry ),
mUniformIndexMap(),
mAttributesLocation(),
mContext = &context;
}
-Renderer::~Renderer()
-{
-}
+Renderer::~Renderer() = default;
void Renderer::SetGeometry( Render::Geometry* geometry )
{
mBlendingOptions.GetBlendDestFactorAlpha() );
// Set blend equations
- context.BlendEquationSeparate( mBlendingOptions.GetBlendEquationRgb(),
- mBlendingOptions.GetBlendEquationAlpha() );
+ Dali::DevelBlendEquation::Type rgbEquation = mBlendingOptions.GetBlendEquationRgb();
+ Dali::DevelBlendEquation::Type alphaEquation = mBlendingOptions.GetBlendEquationAlpha();
+
+ if( mBlendingOptions.IsAdvancedBlendEquationApplied() && mPremultipledAlphaEnabled )
+ {
+ if( rgbEquation != alphaEquation )
+ {
+ DALI_LOG_ERROR( "Advanced Blend Equation have to be appried by using BlendEquation.\n" );
+ }
+ context.BlendEquation( rgbEquation );
+ }
+ else
+ {
+ context.BlendEquationSeparate( rgbEquation, alphaEquation );
+ }
}
mUpdated = true;
mUpdateAttributesLocation = false;
}
+ if( mBlendingOptions.IsAdvancedBlendEquationApplied() && mPremultipledAlphaEnabled )
+ {
+ context.BlendBarrier();
+ }
+
if(mDrawCommands.empty())
{
SetBlending( context, blend );
return true;
}
- std::vector<Render::Texture*> textures = mRenderDataProvider->GetTextures();
- for (Render::Texture* texture : textures)
+ for( const auto& texture : mRenderDataProvider->GetTextures() )
{
if (texture && texture->IsNativeImage())
{