END_TEST;
}
+
+
+int UtcDaliRendererSetDepthFunction(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test setting the depth function");
+
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = CreateShader();
+ Renderer renderer = Renderer::New( geometry, shader );
+
+ Actor actor = Actor::New();
+ actor.AddRenderer(renderer);
+ actor.SetSize(400, 400);
+ Stage stage = Stage::GetCurrent();
+ stage.GetRootLayer().SetBehavior( Layer::LAYER_3D );
+ stage.Add(actor);
+
+ TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+ glAbstraction.EnableEnableDisableCallTrace(true);
+ glAbstraction.EnableDepthFunctionCallTrace(true);
+
+ TraceCallStack& glEnableDisableStack = glAbstraction.GetEnableDisableTrace();
+ TraceCallStack& glDepthFunctionStack = glAbstraction.GetDepthFunctionTrace();
+
+ std::ostringstream depthTestStr;
+ depthTestStr << GL_DEPTH_TEST;
+
+ //OFF
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::OFF);
+ glEnableDisableStack.Reset();
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ //Depth testing should be disabled
+ DALI_TEST_CHECK( glEnableDisableStack.FindMethodAndParams( "Disable", depthTestStr.str().c_str() ) );
+ }
+
+ //GL_NEVER
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::NEVER);
+
+ glEnableDisableStack.Reset();
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK( glEnableDisableStack.FindMethodAndParams( "Enable", depthTestStr.str().c_str() ) );
+ std::ostringstream depthFunctionStr;
+ depthFunctionStr << GL_NEVER;
+ DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
+ }
+
+ //GL_ALWAYS
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::ALWAYS);
+
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ std::ostringstream depthFunctionStr;
+ depthFunctionStr << GL_ALWAYS;
+ DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
+ }
+
+ //GL_LESS
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::LESS);
+
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ std::ostringstream depthFunctionStr;
+ depthFunctionStr << GL_LESS;
+ DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
+ }
+
+ //GL_GREATER
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::GREATER);
+
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ std::ostringstream depthFunctionStr;
+ depthFunctionStr << GL_GREATER;
+ DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
+ }
+
+ //GL_EQUAL
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::EQUAL);
+
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ std::ostringstream depthFunctionStr;
+ depthFunctionStr << GL_EQUAL;
+ DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
+ }
+
+ //GL_NOTEQUAL
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::NOT_EQUAL);
+
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ std::ostringstream depthFunctionStr;
+ depthFunctionStr << GL_NOTEQUAL;
+ DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
+ }
+
+ //GL_LEQUAL
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::LESS_EQUAL);
+
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ std::ostringstream depthFunctionStr;
+ depthFunctionStr << GL_LEQUAL;
+ DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
+ }
+
+ //GL_GEQUAL
+ {
+ renderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::GREATER_EQUAL);
+
+ glDepthFunctionStack.Reset();
+ application.SendNotification();
+ application.Render();
+
+ std::ostringstream depthFunctionStr;
+ depthFunctionStr << GL_GEQUAL;
+ DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
+ }
+
+ END_TEST;
+}
inline void DepthFunc(GLenum func)
{
+ std::stringstream out;
+ out << func;
+ mDepthFunctionTrace.PushCall("DepthFunc", out.str());
}
inline void DepthMask(GLboolean flag)
inline void ResetDrawCallStack() { mDrawTrace.Reset(); }
inline TraceCallStack& GetDrawTrace() { return mDrawTrace; }
+ //Methods for Depth function verification
+ inline void EnableDepthFunctionCallTrace(bool enable) { mDepthFunctionTrace.Enable(enable); }
+ inline void ResetDepthFunctionCallStack() { mDepthFunctionTrace.Reset(); }
+ inline TraceCallStack& GetDepthFunctionTrace() { return mDepthFunctionTrace; }
+
template <typename T>
inline bool GetUniformValue( const char* name, T& value ) const
{
TraceCallStack mTextureTrace;
TraceCallStack mTexParamaterTrace;
TraceCallStack mDrawTrace;
+ TraceCallStack mDepthFunctionTrace;
// Shaders & Uniforms
GLuint mLastShaderIdUsed;
} // namespace DepthWriteMode
+namespace DepthFunction
+{
+
+/**
+ * @brief Depth functions
+ */
+enum Type
+{
+ OFF, ///< Depth test is disabled
+ NEVER, ///< Depth test never passes
+ ALWAYS, ///< Depth test always passes
+ LESS, ///< Depth test passes if the incoming depth value is less than the stored depth value
+ GREATER, ///< Depth test passes if the incoming depth value is greater than the stored depth value
+ EQUAL, ///< Depth test passes if the incoming depth value is equal to the stored depth value
+ NOT_EQUAL, ///< Depth test passes if the incoming depth value is not equal to the stored depth value
+ LESS_EQUAL, ///< Depth test passes if the incoming depth value is less than or equal to the stored depth value
+ GREATER_EQUAL ///< Depth test passes if the incoming depth value is greater than or equal to the stored depth value
+};
+
+} // namespace DepthFunction
+
/**
* @brief Renderer is a handle to an object used to show content by combining a Geometry, a TextureSet and a shader
*/
* @see DepthWriteMode
* @note The default value is DepthWriteMode::AUTO
*/
- DEPTH_WRITE_MODE
+ DEPTH_WRITE_MODE,
+
+ /**
+ * @brief name "depthFunction", type INTEGER
+ * @see DepthFunction
+ * @note The default value is DepthFunction::LESS
+ */
+ DEPTH_FUNCTION
};
};
template <> struct ParameterType< Dali::FaceCullingMode::Type > : public BasicType< Dali::FaceCullingMode::Type > {};
template <> struct ParameterType< Dali::BlendMode::Type > : public BasicType< Dali::BlendMode::Type > {};
template <> struct ParameterType< Dali::DepthWriteMode::Type > : public BasicType< Dali::DepthWriteMode::Type > {};
+template <> struct ParameterType< Dali::DepthFunction::Type > : public BasicType< Dali::DepthFunction::Type > {};
} //namespace Internal
DALI_PROPERTY( "indexRangeFirst", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_FIRST )
DALI_PROPERTY( "indexRangeCount", INTEGER, true, false, false, Dali::Renderer::Property::INDEX_RANGE_COUNT )
DALI_PROPERTY( "depthWriteMode", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_WRITE_MODE )
+DALI_PROPERTY( "depthFunction", INTEGER, true, false, false, Dali::Renderer::Property::DEPTH_FUNCTION )
DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX )
const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> RENDERER_IMPL = { DEFAULT_PROPERTY_DETAILS };
break;
}
+ case Dali::Renderer::Property::DEPTH_FUNCTION:
+ {
+ int value;
+ propertyValue.Get( value );
+ DepthFunction::Type depthFunction = static_cast<DepthFunction::Type>(value);
+ if( depthFunction != mDepthFunction )
+ {
+ mDepthFunction = depthFunction;
+ SetDepthFunctionMessage( GetEventThreadServices(), *mSceneObject, depthFunction );
+ }
+
+ break;
+ }
}
}
value = mDepthWriteMode;
break;
}
+ case Dali::Renderer::Property::DEPTH_FUNCTION:
+ {
+ value = mDepthFunction;
+ break;
+ }
}
return value;
}
mBlendMode( BlendMode::AUTO ),
mBlendingOptions(),
mDepthWriteMode( DepthWriteMode::AUTO ),
+ mDepthFunction( DepthFunction::LESS ),
mPremultipledAlphaEnabled( false )
{
}
BlendMode::Type mBlendMode; ///< Local copy of blending mode
BlendingOptions mBlendingOptions; ///< Local copy of blending options bitmask
Dali::DepthWriteMode::Type mDepthWriteMode; ///< Local copy of depth write mode
+ Dali::DepthFunction::Type mDepthFunction; ///< Local copy of depth function
bool mPremultipledAlphaEnabled : 1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
};
{
/**
+ * Helper to set the depth function
+ * @param[in] context The GL context
+ * @param[in] depthFunction The depth function
+ */
+inline void SetDepthFunction( Context& context, DepthFunction::Type depthFunction )
+{
+ switch( depthFunction )
+ {
+ case DepthFunction::OFF:
+ {
+ context.EnableDepthBuffer( false );
+ break;
+ }
+ case DepthFunction::NEVER:
+ {
+ context.EnableDepthBuffer( true );
+ context.DepthFunc( GL_NEVER );
+ break;
+ }
+ case DepthFunction::ALWAYS:
+ {
+ context.EnableDepthBuffer( true );
+ context.DepthFunc( GL_ALWAYS );
+ break;
+ }
+ case DepthFunction::LESS:
+ {
+ context.EnableDepthBuffer( true );
+ context.DepthFunc( GL_LESS );
+ break;
+ }
+ case DepthFunction::GREATER:
+ {
+ context.EnableDepthBuffer( true );
+ context.DepthFunc( GL_GREATER );
+ break;
+ }
+ case DepthFunction::EQUAL:
+ {
+ context.EnableDepthBuffer( true );
+ context.DepthFunc( GL_EQUAL );
+ break;
+ }
+ case DepthFunction::NOT_EQUAL:
+ {
+ context.EnableDepthBuffer( true );
+ context.DepthFunc( GL_NOTEQUAL );
+ break;
+ }
+ case DepthFunction::LESS_EQUAL:
+ {
+ context.EnableDepthBuffer( true );
+ context.DepthFunc( GL_LEQUAL );
+ break;
+ }
+ case DepthFunction::GREATER_EQUAL:
+ {
+ context.EnableDepthBuffer( true );
+ context.DepthFunc( GL_GEQUAL );
+ break;
+ }
+ }
+}
+
+/**
* Sets up the scissor test if required.
* @param[in] renderList The render list from which to get the clipping flag
* @param[in] context The context
context.DepthMask( ( depthWriteMode == DepthWriteMode::AUTO && item.mIsOpaque ) ||
( depthWriteMode == DepthWriteMode::ON ) );
+ SetDepthFunction( context, item.mRenderer->GetDepthFunction() );
item.mRenderer->Render( context, textureCache, bufferIndex, *item.mNode, defaultShader,
item.mModelMatrix, item.mModelViewMatrix, viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque );
}
mBlendFuncSeparateDstAlpha(GL_ZERO),
mBlendEquationSeparateModeRGB( GL_FUNC_ADD ),
mBlendEquationSeparateModeAlpha( GL_FUNC_ADD ),
+ mDepthFunction( GL_LESS ),
mMaxTextureSize(0),
mClearColor(Color::WHITE), // initial color, never used until it's been set by the user
mCullFaceMode( FaceCullingMode::NONE ),
*/
void DepthFunc(GLenum func)
{
- LOG_GL("DepthFunc %x\n", func);
- CHECK_GL( mGlAbstraction, mGlAbstraction.DepthFunc(func) );
+ if( func != mDepthFunction )
+ {
+ mDepthFunction = func;
+ LOG_GL("DepthFunc %x\n", func);
+ CHECK_GL( mGlAbstraction, mGlAbstraction.DepthFunc(func) );
+ }
}
/**
GLenum mBlendEquationSeparateModeRGB; ///< Controls RGB blend mode
GLenum mBlendEquationSeparateModeAlpha; ///< Controls Alpha blend mode
+ GLenum mDepthFunction; ///The depth function
+
GLint mMaxTextureSize; ///< return value from GetIntegerv(GL_MAX_TEXTURE_SIZE)
Vector4 mClearColor; ///< clear color
const Vector4* blendColor,
FaceCullingMode::Type faceCullingMode,
bool preMultipliedAlphaEnabled,
- DepthWriteMode::Type depthWriteMode )
+ DepthWriteMode::Type depthWriteMode,
+ DepthFunction::Type depthFunction )
{
- return new Renderer( dataProvider, geometry, blendingBitmask, blendColor, faceCullingMode, preMultipliedAlphaEnabled, depthWriteMode );
+ return new Renderer( dataProvider, geometry, blendingBitmask, blendColor, faceCullingMode, preMultipliedAlphaEnabled, depthWriteMode, depthFunction );
}
Renderer::Renderer( SceneGraph::RenderDataProvider* dataProvider,
const Vector4* blendColor,
FaceCullingMode::Type faceCullingMode,
bool preMultipliedAlphaEnabled,
- DepthWriteMode::Type depthWriteMode )
+ DepthWriteMode::Type depthWriteMode,
+ DepthFunction::Type depthFunction )
: mRenderDataProvider( dataProvider ),
mContext(NULL),
mTextureCache( NULL ),
mBlendingOptions(),
mFaceCullingMode( faceCullingMode ),
mDepthWriteMode( depthWriteMode ),
+ mDepthFunction( depthFunction ),
mIndexedDrawFirstElement( 0 ),
mIndexedDrawElementsCount( 0 ),
mUpdateAttributesLocation( true ),
return mDepthWriteMode;
}
+void Renderer::SetDepthFunction( DepthFunction::Type depthFunction )
+{
+ mDepthFunction = depthFunction;
+}
+
+DepthFunction::Type Renderer::GetDepthFunction() const
+{
+ return mDepthFunction;
+}
+
void Renderer::Render( Context& context,
SceneGraph::TextureCache& textureCache,
BufferIndex bufferIndex,
* @param[in] faceCullingMode The face-culling mode.
* @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied.
* @param[in] depthWriteMode Depth buffer write mode
+ * @param[in] depthFunction Depth function
*/
static Renderer* New( SceneGraph::RenderDataProvider* dataProviders,
Render::Geometry* geometry,
const Vector4* blendColor,
FaceCullingMode::Type faceCullingMode,
bool preMultipliedAlphaEnabled,
- DepthWriteMode::Type depthWriteMode );
+ DepthWriteMode::Type depthWriteMode,
+ DepthFunction::Type depthFunction );
/**
* Constructor.
* @param[in] faceCullingMode The face-culling mode.
* @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied.
* @param[in] depthWriteMode Depth buffer write mode
+ * @param[in] depthFunction Depth function
*/
Renderer( SceneGraph::RenderDataProvider* dataProviders,
Render::Geometry* geometry,
const Vector4* blendColor,
FaceCullingMode::Type faceCullingMode,
bool preMultipliedAlphaEnabled,
- DepthWriteMode::Type depthWriteMode );
+ DepthWriteMode::Type depthWriteMode,
+ DepthFunction::Type depthFunction );
/**
* Change the data providers of the renderer
void EnablePreMultipliedAlpha( bool preMultipled );
/**
+ * Sets the depth write mode
+ * @param[in] depthWriteMode The depth write mode
+ */
+ void SetDepthWriteMode( DepthWriteMode::Type depthWriteMode );
+
+ /**
* Query the Renderer's depth write mode
* @return The renderer depth write mode
*/
DepthWriteMode::Type GetDepthWriteMode() const;
/**
- * Sets the depth write mode
- * @param[in] depthWriteMode The depth write mode
+ * Sets the depth function
+ * @param[in] depthFunction The depth function
*/
- void SetDepthWriteMode( DepthWriteMode::Type depthWriteMode );
+ void SetDepthFunction( DepthFunction::Type depthFunction );
+
+ /**
+ * Query the Renderer's depth function
+ * @return The renderer depth function
+ */
+ DepthFunction::Type GetDepthFunction() const;
/**
* Called to render during RenderManager::Render().
BlendingOptions mBlendingOptions; /// Blending options including blend color, blend func and blend equation
FaceCullingMode::Type mFaceCullingMode; /// Mode of face culling
DepthWriteMode::Type mDepthWriteMode; /// Depth write mode
+ DepthFunction::Type mDepthFunction; /// Depth function
size_t mIndexedDrawFirstElement; /// Offset of first element to draw
size_t mIndexedDrawElementsCount; /// Number of elements to draw
RESEND_INDEXED_DRAW_FIRST_ELEMENT = 1 << 6,
RESEND_INDEXED_DRAW_ELEMENTS_COUNT = 1 << 7,
RESEND_DEPTH_WRITE_MODE = 1 << 8,
+ RESEND_DEPTH_FUNCTION = 1 << 9,
};
}
mFaceCullingMode( FaceCullingMode::NONE ),
mBlendMode( BlendMode::AUTO ),
mDepthWriteMode( DepthWriteMode::AUTO ),
+ mDepthFunction( DepthFunction::LESS ),
mIndexedDrawFirstElement( 0 ),
mIndexedDrawElementsCount( 0 ),
mReferenceCount( 0 ),
new (slot) DerivedType( mRenderer, &Render::Renderer::SetDepthWriteMode, mDepthWriteMode );
}
+ if( mResendFlag & RESEND_DEPTH_FUNCTION )
+ {
+ typedef MessageValue1< Render::Renderer, DepthFunction::Type > DerivedType;
+ unsigned int* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( updateBufferIndex, sizeof( DerivedType ) );
+ new (slot) DerivedType( mRenderer, &Render::Renderer::SetDepthFunction, mDepthFunction );
+ }
+
mResendFlag = 0;
}
}
mDepthIndex = depthIndex;
}
-void Renderer::SetFaceCullingMode( unsigned int faceCullingMode )
+void Renderer::SetFaceCullingMode( FaceCullingMode::Type faceCullingMode )
{
- mFaceCullingMode = static_cast< FaceCullingMode::Type >( faceCullingMode );
+ mFaceCullingMode = faceCullingMode;
mResendFlag |= RESEND_FACE_CULLING_MODE;
}
-void Renderer::SetBlendMode( unsigned int blendingMode )
+void Renderer::SetBlendMode( BlendMode::Type blendingMode )
{
- mBlendMode = static_cast< BlendMode::Type >( blendingMode );
+ mBlendMode = blendingMode;
}
void Renderer::SetBlendingOptions( unsigned int options )
mResendFlag |= RESEND_PREMULTIPLIED_ALPHA;
}
-void Renderer::SetDepthWriteMode( unsigned int depthWriteMode )
+void Renderer::SetDepthWriteMode( DepthWriteMode::Type depthWriteMode )
{
- mDepthWriteMode = static_cast< DepthWriteMode::Type >( depthWriteMode );
+ mDepthWriteMode = depthWriteMode;
mResendFlag |= RESEND_DEPTH_WRITE_MODE;
}
+void Renderer::SetDepthFunction( DepthFunction::Type depthFunction )
+{
+ mDepthFunction = depthFunction;
+ mResendFlag |= RESEND_DEPTH_FUNCTION;
+}
+
//Called when a node with this renderer is added to the stage
void Renderer::OnStageConnect()
{
mBlendBitmask, mBlendColor,
static_cast< FaceCullingMode::Type >( mFaceCullingMode ),
mPremultipledAlphaEnabled,
- mDepthWriteMode );
+ mDepthWriteMode,
+ mDepthFunction );
mSceneController->GetRenderMessageDispatcher().AddRenderer( *mRenderer );
mResendFlag = 0;
#include <dali/devel-api/rendering/geometry.h>
#include <dali/devel-api/rendering/renderer.h> // Dali::Renderer
#include <dali/internal/common/blending-options.h>
+#include <dali/internal/common/type-abstraction-enums.h>
#include <dali/internal/event/common/event-thread-services.h>
#include <dali/internal/update/common/property-owner.h>
#include <dali/internal/update/common/uniform-map.h>
* Set the face culling mode
* @param[in] faceCullingMode to use
*/
- void SetFaceCullingMode( unsigned int faceCullingMode );
+ void SetFaceCullingMode( FaceCullingMode::Type faceCullingMode );
/**
* Set the blending mode
* @param[in] blendingMode to use
*/
- void SetBlendMode( unsigned int blendingMode );
+ void SetBlendMode( BlendMode::Type blendingMode );
/**
* Set the blending options. This should only be called from the update thread.
* Sets the depth buffer write mode
* @param[in] depthWriteMode The depth buffer write mode
*/
- void SetDepthWriteMode( unsigned int depthWriteMode );
+ void SetDepthWriteMode( DepthWriteMode::Type depthWriteMode );
+
+ /**
+ * Sets the depth function
+ * @param[in] depthFunction The depth function
+ */
+ void SetDepthFunction( DepthFunction::Type depthFunction );
/**
* Called when an actor with this renderer is added to the stage
FaceCullingMode::Type mFaceCullingMode; ///< The mode of face culling
BlendMode::Type mBlendMode; ///< The mode of blending
DepthWriteMode::Type mDepthWriteMode; ///< The depth write mode
+ DepthFunction::Type mDepthFunction; ///< The depth function
CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps collected by the renderer
size_t mIndexedDrawElementsCount; ///< number of elements to be drawn using indexed draw
unsigned int mReferenceCount; ///< Number of nodes currently using this renderer
unsigned int mRegenerateUniformMap; ///< 2 if the map should be regenerated, 1 if it should be copied.
- unsigned char mResendFlag; ///< Indicate whether data should be resent to the renderer
+ unsigned short mResendFlag; ///< Indicate whether data should be resent to the renderer
bool mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame
bool mResourcesReady; ///< Set during the Update algorithm; true if the renderer has resources ready for the current frame.
bool mFinishedResourceAcquisition; ///< Set during DoPrepareResources; true if ready & all resource acquisition has finished (successfully or otherwise)
new (slot) LocalType( &renderer, &Renderer::SetDepthIndex, depthIndex );
}
-inline void SetFaceCullingModeMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, Dali::FaceCullingMode::Type faceCullingMode )
+inline void SetFaceCullingModeMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, FaceCullingMode::Type faceCullingMode )
{
- typedef MessageValue1< Renderer, unsigned int > LocalType;
+ typedef MessageValue1< Renderer, FaceCullingMode::Type > LocalType;
// Reserve some memory inside the message queue
unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
inline void SetBlendModeMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, BlendMode::Type blendingMode )
{
- typedef MessageValue1< Renderer, unsigned int > LocalType;
+ typedef MessageValue1< Renderer, BlendMode::Type > LocalType;
// Reserve some memory inside the message queue
unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
new (slot) LocalType( &renderer, &Renderer::EnablePreMultipliedAlpha, preMultiplied );
}
-inline void SetDepthWriteModeMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, Dali::DepthWriteMode::Type depthWriteMode )
+inline void SetDepthWriteModeMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, DepthWriteMode::Type depthWriteMode )
{
- typedef MessageValue1< Renderer, unsigned int > LocalType;
+ typedef MessageValue1< Renderer, DepthWriteMode::Type > LocalType;
// Reserve some memory inside the message queue
unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
new (slot) LocalType( &renderer, &Renderer::SetDepthWriteMode, depthWriteMode );
}
+inline void SetDepthFunctionMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, DepthFunction::Type depthFunction )
+{
+ typedef MessageValue1< Renderer, DepthFunction::Type > LocalType;
+
+ // Reserve some memory inside the message queue
+ unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+ new (slot) LocalType( &renderer, &Renderer::SetDepthFunction, depthFunction );
+}
+
inline void OnStageConnectMessage( EventThreadServices& eventThreadServices, const Renderer& renderer )
{
typedef Message< Renderer > LocalType;