+void Renderer::SetStencilMode( StencilMode::Type stencilMode )
+{
+ mStencilParameters.stencilMode = stencilMode;
+}
+
+StencilMode::Type Renderer::GetStencilMode() const
+{
+ return mStencilParameters.stencilMode;
+}
+
+void Renderer::SetStencilFunction( StencilFunction::Type stencilFunction )
+{
+ mStencilParameters.stencilFunction = stencilFunction;
+}
+
+StencilFunction::Type Renderer::GetStencilFunction() const
+{
+ return mStencilParameters.stencilFunction;
+}
+
+void Renderer::SetStencilFunctionMask( int stencilFunctionMask )
+{
+ mStencilParameters.stencilFunctionMask = stencilFunctionMask;
+}
+
+int Renderer::GetStencilFunctionMask() const
+{
+ return mStencilParameters.stencilFunctionMask;
+}
+
+void Renderer::SetStencilFunctionReference( int stencilFunctionReference )
+{
+ mStencilParameters.stencilFunctionReference = stencilFunctionReference;
+}
+
+int Renderer::GetStencilFunctionReference() const
+{
+ return mStencilParameters.stencilFunctionReference;
+}
+
+void Renderer::SetStencilMask( int stencilMask )
+{
+ mStencilParameters.stencilMask = stencilMask;
+}
+
+int Renderer::GetStencilMask() const
+{
+ return mStencilParameters.stencilMask;
+}
+
+void Renderer::SetStencilOperationOnFail( StencilOperation::Type stencilOperationOnFail )
+{
+ mStencilParameters.stencilOperationOnFail = stencilOperationOnFail;
+}
+
+StencilOperation::Type Renderer::GetStencilOperationOnFail() const
+{
+ return mStencilParameters.stencilOperationOnFail;
+}
+
+void Renderer::SetStencilOperationOnZFail( StencilOperation::Type stencilOperationOnZFail )
+{
+ mStencilParameters.stencilOperationOnZFail = stencilOperationOnZFail;
+}
+
+StencilOperation::Type Renderer::GetStencilOperationOnZFail() const
+{
+ return mStencilParameters.stencilOperationOnZFail;
+}
+
+void Renderer::SetStencilOperationOnZPass( StencilOperation::Type stencilOperationOnZPass )
+{
+ mStencilParameters.stencilOperationOnZPass = stencilOperationOnZPass;
+}
+
+StencilOperation::Type Renderer::GetStencilOperationOnZPass() const
+{
+ return mStencilParameters.stencilOperationOnZPass;
+}
+
+void Renderer::SetWriteToColorBuffer( bool writeToColorBuffer )
+{
+ mWriteToColorBuffer = writeToColorBuffer;
+}
+
+bool Renderer::GetWriteToColorBuffer() const
+{
+ return mWriteToColorBuffer;
+}
+
+void Renderer::Render( Context& context,
+ SceneGraph::TextureCache& textureCache,
+ BufferIndex bufferIndex,
+ const SceneGraph::NodeDataProvider& node,
+ SceneGraph::Shader& defaultShader,
+ const Matrix& modelMatrix,
+ const Matrix& modelViewMatrix,
+ const Matrix& viewMatrix,
+ const Matrix& projectionMatrix,
+ const Vector3& size,
+ bool blend )
+{
+ // Get the program to use:
+ Program* program = mRenderDataProvider->GetShader().GetProgram();
+ if( !program )
+ {
+ // if program is NULL it means this is a custom shader with non matching geometry type so we need to use default shaders program
+ program = defaultShader.GetProgram();
+ DALI_ASSERT_DEBUG( program && "Default shader should always have a program available." );
+ if( !program )
+ {
+ DALI_LOG_ERROR( "Failed to get program for shader at address %p.", (void*)&mRenderDataProvider->GetShader() );
+ return;
+ }
+ }
+
+ //Set cull face mode
+ context.CullFace( mFaceCullingMode );
+
+ //Set blending mode
+ SetBlending( context, blend );
+
+ // Take the program into use so we can send uniforms to it
+ program->Use();
+
+ if( DALI_LIKELY( BindTextures( context, textureCache, *program ) ) )