mScissorTestEnabled(false),
mStencilBufferEnabled(false),
mClearColorSet(false),
+ mUsingDefaultBlendColor(true),
mBoundArrayBufferId(0),
mBoundElementArrayBufferId(0),
mBoundTransformFeedbackBufferId(0),
mActiveTextureUnit( TEXTURE_UNIT_LAST ),
- mUsingDefaultBlendColor(true),
+ mBlendColor(Color::TRANSPARENT),
mBlendFuncSeparateSrcRGB(GL_ONE),
mBlendFuncSeparateDstRGB(GL_ZERO),
mBlendFuncSeparateSrcAlpha(GL_ONE),
*/
void SetDefaultBlendColor()
{
- if( !mUsingDefaultBlendColor )
+ if( ! mUsingDefaultBlendColor )
{
- LOG_GL( "BlendColor %f %f %f %f\n", 0.0f, 0.0f, 0.0f, 0.0f );
- CHECK_GL( mGlAbstraction, mGlAbstraction.BlendColor( 0.0f, 0.0f, 0.0f, 0.0f ) );
+ SetCustomBlendColor( Color::TRANSPARENT );
mUsingDefaultBlendColor = true;
}
}
*/
void SetCustomBlendColor( const Vector4& color )
{
- LOG_GL( "BlendColor %f %f %f %f\n", color.r, color.g, color.b, color.a );
- CHECK_GL( mGlAbstraction, mGlAbstraction.BlendColor(color.r, color.g, color.b, color.a) );
- mUsingDefaultBlendColor = false;
+ if( mUsingDefaultBlendColor || mBlendColor != color )
+ {
+ LOG_GL( "BlendColor %f %f %f %f\n", color.r, color.g, color.b, color.a );
+ CHECK_GL( mGlAbstraction, mGlAbstraction.BlendColor( color.r, color.g, color.b, color.a ) );
+ mUsingDefaultBlendColor = false;
+ mBlendColor = color;
+ }
}
/**
bool mScissorTestEnabled;
bool mStencilBufferEnabled;
bool mClearColorSet;
+ bool mUsingDefaultBlendColor;
// glBindBuffer() state
GLuint mBoundArrayBufferId; ///< The ID passed to glBindBuffer(GL_ARRAY_BUFFER)
GLuint mBound2dTextureId[ MAX_TEXTURE_UNITS ]; ///< The ID passed to glBindTexture(GL_TEXTURE_2D)
// glBlendColor() state
- bool mUsingDefaultBlendColor;
+ Vector4 mBlendColor; ///< Blend color
// glBlendFuncSeparate() state
GLenum mBlendFuncSeparateSrcRGB; ///< The srcRGB parameter passed to glBlendFuncSeparate()
Material::Material()
: mColor( Color::WHITE ),
- mBlendColor( Color::WHITE ),
+ mBlendColor( Color::TRANSPARENT ),
mFaceCullingMode(Dali::Material::NONE),
mBlendingMode(Dali::BlendingMode::AUTO),
mBlendingOptions( DEFAULT_BLENDING_OPTIONS ),