*/
// INTERNAL INCLUDES
-#include <dali/public-api/actors/renderable-actor.h>
#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/math/rect.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/gl-abstraction.h>
#include <dali/integration-api/gl-defines.h>
+#include <dali/devel-api/rendering/material.h>
#include <dali/internal/render/common/performance-monitor.h>
#include <dali/internal/render/gl-resources/texture-units.h>
#include <dali/internal/render/gl-resources/frame-buffer-state-cache.h>
LOG_GL("BindTexture GL_TEXTURE_2D %d\n", texture);
CHECK_GL( mGlAbstraction, mGlAbstraction.BindTexture(GL_TEXTURE_2D, texture) );
-
- INCREASE_COUNTER(PerformanceMonitor::TEXTURE_STATE_CHANGES);
}
}
*/
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;
+ }
}
/**
* enables GL_CULL_FACE if in any of the face culling modes
* otherwise disables GL_CULL_FACE
*/
- void CullFace(CullFaceMode mode)
+ void CullFace( Dali::Material::FaceCullingMode mode )
{
// Avoid unnecessary calls to gl
if(mCullFaceMode != mode)
mCullFaceMode = mode;
switch(mode)
{
- case CullNone:
+ case Dali::Material::NONE:
{
LOG_GL("Disable GL_CULL_FACE\n");
CHECK_GL( mGlAbstraction, mGlAbstraction.Disable(GL_CULL_FACE) );
break;
}
- case CullFront:
+ case Dali::Material::CULL_FRONT:
{
LOG_GL("Enable GL_CULL_FACE\n");
CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
break;
}
- case CullBack:
+ case Dali::Material::CULL_BACK:
{
LOG_GL("Enable GL_CULL_FACE\n");
CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
break;
}
- case CullFrontAndBack:
+ case Dali::Material::CULL_BACK_AND_FRONT:
{
LOG_GL("Enable GL_CULL_FACE\n");
CHECK_GL( mGlAbstraction, mGlAbstraction.Enable(GL_CULL_FACE) );
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()
Vector4 mClearColor; ///< clear color
// Face culling mode
- CullFaceMode mCullFaceMode;
+ Dali::Material::FaceCullingMode mCullFaceMode;
// cached viewport size
Rect< int > mViewPort;