+ * @brief Struct to encapsulate stencil parameters required for control of the stencil buffer.
+ */
+ struct StencilParameters
+ {
+ StencilParameters( StencilMode::Type stencilMode, StencilFunction::Type stencilFunction, int stencilFunctionMask,
+ int stencilFunctionReference, int stencilMask, StencilOperation::Type stencilOperationOnFail,
+ StencilOperation::Type stencilOperationOnZFail, StencilOperation::Type stencilOperationOnZPass )
+ : stencilFunctionMask ( stencilFunctionMask ),
+ stencilFunctionReference ( stencilFunctionReference ),
+ stencilMask ( stencilMask ),
+ stencilFunction ( stencilFunction ),
+ stencilOperationOnFail ( stencilOperationOnFail ),
+ stencilOperationOnZFail ( stencilOperationOnZFail ),
+ stencilOperationOnZPass ( stencilOperationOnZPass ),
+ stencilMode ( stencilMode )
+ {
+ }
+
+ int stencilFunctionMask; ///< The stencil function mask
+ int stencilFunctionReference; ///< The stencil function reference
+ int stencilMask; ///< The stencil mask
+ StencilFunction::Type stencilFunction:3; ///< The stencil function
+ StencilOperation::Type stencilOperationOnFail:3; ///< The stencil operation for stencil test fail
+ StencilOperation::Type stencilOperationOnZFail:3; ///< The stencil operation for depth test fail
+ StencilOperation::Type stencilOperationOnZPass:3; ///< The stencil operation for depth test pass
+ StencilMode::Type stencilMode:2; ///< The stencil mode
+ };
+
+ /**
+ * @copydoc Dali::Internal::GlResourceOwner::GlContextDestroyed()
+ */
+ void GlContextDestroyed();
+
+ /**
+ * @copydoc Dali::Internal::GlResourceOwner::GlCleanup()
+ */
+ void GlCleanup();
+
+ /**
+ * Create a new renderer instance
+ * @param[in] dataProviders The data providers for the renderer
+ * @param[in] geometry The geometry for the renderer
+ * @param[in] blendingBitmask A bitmask of blending options.
+ * @param[in] blendColor The blend color to pass to GL
+ * @param[in] faceCullingMode The face-culling mode.
+ * @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied.
+ * @param[in] depthWriteMode Depth buffer write mode
+ * @param[in] depthTestMode Depth buffer test mode
+ * @param[in] depthFunction Depth function
+ * @param[in] stencilParameters Struct containing all stencil related options
+ * @param[in] writeToColorBuffer Set to True to write to the color buffer
+ */
+ static Renderer* New( SceneGraph::RenderDataProvider* dataProviders,
+ Render::Geometry* geometry,
+ unsigned int blendingBitmask,
+ const Vector4* blendColor,
+ FaceCullingMode::Type faceCullingMode,
+ bool preMultipliedAlphaEnabled,
+ DepthWriteMode::Type depthWriteMode,
+ DepthTestMode::Type depthTestMode,
+ DepthFunction::Type depthFunction,
+ StencilParameters& stencilParameters,
+ bool writeToColorBuffer );
+
+ /**
+ * Constructor.
+ * @param[in] dataProviders The data providers for the renderer
+ * @param[in] geometry The geometry for the renderer
+ * @param[in] blendingBitmask A bitmask of blending options.
+ * @param[in] blendColor The blend color to pass to GL
+ * @param[in] faceCullingMode The face-culling mode.
+ * @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied.
+ * @param[in] depthWriteMode Depth buffer write mode
+ * @param[in] depthTestMode Depth buffer test mode
+ * @param[in] depthFunction Depth function
+ * @param[in] stencilParameters Struct containing all stencil related options
+ * @param[in] writeToColorBuffer Set to True to write to the color buffer
+ */
+ Renderer( SceneGraph::RenderDataProvider* dataProviders,
+ Render::Geometry* geometry,
+ unsigned int blendingBitmask,
+ const Vector4* blendColor,
+ FaceCullingMode::Type faceCullingMode,
+ bool preMultipliedAlphaEnabled,
+ DepthWriteMode::Type depthWriteMode,
+ DepthTestMode::Type depthTestMode,
+ DepthFunction::Type depthFunction,
+ StencilParameters& stencilParameters,
+ bool writeToColorBuffer );
+
+ /**
+ * Change the data providers of the renderer
+ * @param[in] dataProviders The data providers
+ */
+ void SetRenderDataProvider( SceneGraph::RenderDataProvider* dataProviders );
+
+ /**
+ * Change the geometry used by the renderer
+ * @param[in] geometry The new geometry
+ */
+ void SetGeometry( Render::Geometry* geometry );
+ /**