X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Frendering%2Frenderer-impl.h;h=5d8bade627b241cb0a310ac6c2f8a84256881a83;hb=4d75040ab200bd306ec5a48f2a617480062eef4c;hp=6708129fdadb061908847790ec1c46e73c1d5b74;hpb=4805f154c85adcf71716d9aa6746b6ba1b44a19e;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/rendering/renderer-impl.h b/dali/internal/event/rendering/renderer-impl.h old mode 100644 new mode 100755 index 6708129..5d8bade --- a/dali/internal/event/rendering/renderer-impl.h +++ b/dali/internal/event/rendering/renderer-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_RENDERER_H /* - * Copyright (c) 2015 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. @@ -21,13 +21,13 @@ // INTERNAL INCLUDES #include // DALI_ASSERT_ALWAYS #include // Dali::IntrusivePtr -#include // Dali::Renderer +#include // Dali::Renderer #include -#include // Dali::Internal::Connectable #include // Dali::Internal::ObjectConnector #include // Dali::Internal::Object -#include // Dali::Internal::Material +#include // Dali::Internal::TextureSet #include // Dali::Internal::Geometry +#include // Dali::Render::Renderer::StencilParameters namespace Dali { @@ -38,12 +38,11 @@ namespace SceneGraph class Renderer; } - class Renderer; typedef IntrusivePtr RendererPtr; /** - * Renderer is an object that can be used to show content by combining a Geometry with a material. + * Renderer is an object that can be used to show content by combining a Geometry with a shader and textures. */ class Renderer : public Object { @@ -66,14 +65,24 @@ public: Geometry* GetGeometry() const; /** - * @copydoc Dali::Renderer::SetMaterial() + * @copydoc Dali::Renderer::SetTextures() + */ + void SetTextures( TextureSet& textureSet ); + + /** + * @copydoc Dali::Renderer::GetTextures() */ - void SetMaterial( Material& material ); + TextureSet* GetTextures() const; /** - * @copydoc Dali::Renderer::GetMaterial() + * @copydoc Dali::Renderer::SetShader() */ - Material* GetMaterial() const; + void SetShader( Shader& shader ); + + /** + * @copydoc Dali::Renderer::GetShader() + */ + Shader* GetShader() const; /** * @copydoc Dali::Renderer::SetDepthIndex() @@ -85,67 +94,57 @@ public: */ int GetDepthIndex() const; - /** - * @copydoc Dali::Renderer::SetFaceCullingMode() - */ - void SetFaceCullingMode( Dali::Renderer::FaceCullingMode cullingMode ); - - /** - * @copydoc Dali::Renderer::GetFaceCullingMode() - */ - Dali::Renderer::FaceCullingMode GetFaceCullingMode(); - /** * @copydoc Dali::Renderer::SetBlendMode() */ - void SetBlendMode( BlendingMode::Type mode ); + void SetBlendMode( BlendMode::Type mode ); /** * @copydoc Dali::Renderer::GetBlendMode() */ - BlendingMode::Type GetBlendMode() const; + BlendMode::Type GetBlendMode() const; /** * @copydoc Dali::Renderer::SetBlendFunc() */ - void SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba ); + void SetBlendFunc( BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba ); /** * @copydoc Dali::Renderer::SetBlendFunc() */ - void SetBlendFunc( BlendingFactor::Type srcFactorRgb, BlendingFactor::Type destFactorRgb, - BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha ); + void SetBlendFunc( BlendFactor::Type srcFactorRgb, BlendFactor::Type destFactorRgb, + BlendFactor::Type srcFactorAlpha, BlendFactor::Type destFactorAlpha ); /** * @copydoc Dali::Renderer::GetBlendFunc() */ - void GetBlendFunc( BlendingFactor::Type& srcFactorRgb, BlendingFactor::Type& destFactorRgb, - BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const; + void GetBlendFunc( BlendFactor::Type& srcFactorRgb, BlendFactor::Type& destFactorRgb, + BlendFactor::Type& srcFactorAlpha, BlendFactor::Type& destFactorAlpha ) const; /** * @copydoc Dali::Renderer::SetBlendEquation() */ - void SetBlendEquation( BlendingEquation::Type equationRgba ); + void SetBlendEquation( BlendEquation::Type equationRgba ); /** * @copydoc Dali::Renderer::SetBlendEquation() */ - void SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha ); + void SetBlendEquation( BlendEquation::Type equationRgb, BlendEquation::Type equationAlpha ); /** * @copydoc Dali::Renderer::GetBlendEquation() */ - void GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const; + void GetBlendEquation( BlendEquation::Type& equationRgb, BlendEquation::Type& equationAlpha ) const; /** - * @copydoc Dali::Renderer::SetBlendColor() + * @copydoc Dali::Renderer::SetIndexedDrawFirstElement */ - void SetBlendColor( const Vector4& color ); + void SetIndexedDrawFirstElement( size_t firstElement ); /** - * @copydoc Dali::Renderer::GetBlendColor() + * @copydoc Dali::Renderer::SetIndexedDrawElementsCount */ - Vector4 GetBlendColor() const; + void SetIndexedDrawElementsCount( size_t elementsCount ); /** * @brief Set whether the Pre-multiplied Alpha Blending is required @@ -161,12 +160,12 @@ public: */ bool IsPreMultipliedAlphaEnabled() const; - /** - * @brief Get the scene graph object ( the node attachment ) - * - * @return the scene object - */ - SceneGraph::Renderer* GetRendererSceneObject(); + /** + * @brief Get the scene graph object + * + * @return the scene object + */ + SceneGraph::Renderer* GetRendererSceneObject(); public: // Default property extensions from Object @@ -226,6 +225,16 @@ public: // Default property extensions from 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; @@ -250,26 +259,45 @@ public: // Default property extensions from Object */ virtual int GetPropertyComponentIndex( Property::Index index ) const; -public: // Functions from Connectable +private: // implementation + /** - * @copydoc Dali::Internal::Connectable::OnStage() + * @brief Default constructor. */ - virtual bool OnStage() const; + Renderer(); /** - * @copydoc Dali::Internal::Connectable::Connect() + * @brief Initializes the Renderer. */ - virtual void Connect(); + void Initialize(); /** - * @copydoc Dali::Internal::Connectable::Disconnect() + * @brief Sets the blend color. + * @param[in] blendColor The blend color to set. */ - virtual void Disconnect(); + void SetBlendColor( const Vector4& blendColor ); -private: // implementation - Renderer(); + /** + * @brief Retrieves the blend-color. + * @return A const reference to the blend-color + */ + const Vector4& GetBlendColor() const; - void Initialize(); + /** + * @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: /** @@ -282,19 +310,25 @@ private: // unimplemented methods Renderer& operator=( const Renderer& ); private: // data - SceneGraph::Renderer* mSceneObject; - Vector4* mBlendColor; ///< Local copy of blend color, pointer only as its rarely used - ObjectConnector mGeometryConnector; ///< Connector that holds the geometry used by this renderer - ObjectConnector mMaterialConnector; ///< Connector that holds the material used by this renderer - - int mDepthIndex; - int mOnStageCount; - - Dali::Renderer::FaceCullingMode mFaceCullingMode; ///< Local copy of face culling mode - BlendingMode::Type mBlendingMode; ///< Local copy of blending mode - BlendingOptions mBlendingOptions; ///< Local copy of blending options bitmask - bool mPremultipledAlphaEnabled; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required - + 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:4; ///< Local copy of the depth function + FaceCullingMode::Type mFaceCullingMode:3; ///< Local copy of the mode of face culling + BlendMode::Type mBlendMode:3; ///< Local copy of the mode of blending + DepthWriteMode::Type mDepthWriteMode:3; ///< Local copy of the depth write mode + DepthTestMode::Type mDepthTestMode:3; ///< Local copy of the depth test mode + bool mPremultipledAlphaEnabled:1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required }; } // namespace Internal