#define DALI_INTERNAL_RENDERER_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void GetBlendEquation( BlendEquation::Type& equationRgb, BlendEquation::Type& equationAlpha ) const;
/**
- * @copydoc Dali::Renderer::SetBlendColor()
- */
- void SetBlendColor( const Vector4& color );
-
- /**
- * @copydoc Dali::Renderer::GetBlendColor()
- */
- Vector4 GetBlendColor() const;
-
- /**
* @copydoc Dali::Renderer::SetIndexedDrawFirstElement
*/
void SetIndexedDrawFirstElement( size_t firstElement );
bool IsPreMultipliedAlphaEnabled() const;
/**
- * Returns state of batching mode
- * @return batching mode state ( true if enabled )
- */
- bool IsBatchingEnabled() const;
-
- /**
* @brief Get the scene graph object
*
* @return the scene object
virtual Property::Value GetDefaultProperty( Property::Index index ) const;
/**
+ * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
+ */
+ virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
+
+ /**
+ * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
+ */
+ virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType );
+
+ /**
* @copydoc Dali::Internal::Object::GetPropertyOwner()
*/
virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
virtual int GetPropertyComponentIndex( Property::Index index ) const;
private: // implementation
+
+ /**
+ * @brief Default constructor.
+ */
Renderer();
+ /**
+ * @brief Initializes the Renderer.
+ */
void Initialize();
+ /**
+ * @brief Sets the blend color.
+ * @param[in] blendColor The blend color to set.
+ */
+ void SetBlendColor( const Vector4& blendColor );
+
+ /**
+ * @brief Retrieves the blend-color.
+ * @return A const reference to the blend-color
+ */
+ const Vector4& GetBlendColor() const;
+
+ /**
+ * @brief Retrieves the cached event side value of a default property.
+ * @param[in] index The index of the property
+ * @param[out] value Is set with the cached value of the property if found.
+ * @return True if value set, false otherwise.
+ */
+ bool GetCachedPropertyValue( Property::Index index, Property::Value& value ) const;
+
+ /**
+ * @brief Retrieves the current value of a default property from the scene-graph.
+ * @param[in] index The index of the property
+ * @param[out] value Is set with the current scene-graph value of the property
+ * @return True if value set, false otherwise.
+ */
+ bool GetCurrentPropertyValue( Property::Index index, Property::Value& value ) const;
+
protected:
/**
* A reference counted object may only be deleted by calling Unreference()
Renderer& operator=( const Renderer& );
private: // data
- SceneGraph::Renderer* mSceneObject;
- Vector4* mBlendColor; ///< Local copy of blend color, pointer only as its rarely used
- GeometryPtr mGeometry; ///< Connector that holds the geometry used by this renderer
- TextureSetPtr mTextureSet; ///< Connector that holds the texture set used by this renderer
- ShaderPtr mShader; ///< Connector that holds the shader used by this renderer
-
- int mDepthIndex;
-
- size_t mIndexedDrawFirstElement; ///< Offset of first element to draw from bound index buffer
- size_t mIndexedDrawElementCount; ///< Number of elements to draw
-
- Render::Renderer::StencilParameters mStencilParameters; ///< Struct containing all stencil related options
- BlendingOptions mBlendingOptions; ///< Local copy of blending options bitmask
-
- DepthFunction::Type mDepthFunction:3; ///< Local copy of the depth function
- FaceCullingMode::Type mFaceCullingMode:2; ///< Local copy of the mode of face culling
- BlendMode::Type mBlendMode:2; ///< Local copy of the mode of blending
- DepthWriteMode::Type mDepthWriteMode:2; ///< Local copy of the depth write mode
- DepthTestMode::Type mDepthTestMode:2; ///< Local copy of the depth test mode
- bool mPremultipledAlphaEnabled:1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
- bool mBatchingEnabled : 1; ///< Flag indicating whether render is batchable or not
+ SceneGraph::Renderer* mSceneObject;
+ GeometryPtr mGeometry; ///< Connector that holds the geometry used by this renderer
+ TextureSetPtr mTextureSet; ///< Connector that holds the texture set used by this renderer
+ ShaderPtr mShader; ///< Connector that holds the shader used by this renderer
+
+ int mDepthIndex;
+
+ size_t mIndexedDrawFirstElement; ///< Offset of first element to draw from bound index buffer
+ size_t mIndexedDrawElementCount; ///< Number of elements to draw
+
+ Render::Renderer::StencilParameters mStencilParameters; ///< Struct containing all stencil related options
+ BlendingOptions mBlendingOptions; ///< Local copy of blending options bitmask
+
+ float mOpacity; ///< Local copy of the opacity
+
+ DepthFunction::Type mDepthFunction:3; ///< Local copy of the depth function
+ FaceCullingMode::Type mFaceCullingMode:2; ///< Local copy of the mode of face culling
+ BlendMode::Type mBlendMode:2; ///< Local copy of the mode of blending
+ DepthWriteMode::Type mDepthWriteMode:2; ///< Local copy of the depth write mode
+ DepthTestMode::Type mDepthTestMode:2; ///< Local copy of the depth test mode
+ bool mPremultipledAlphaEnabled:1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
};
} // namespace Internal