X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Feffects%2Fshader-effect-impl.h;h=0ee4e07a4ac3aceb98c55d921296d07342c84e0b;hb=ff364987bf3c2ef5bb2b57348747eeb784d8ba90;hp=2ccc768ec185a602e845cc8b779a1e93ae6f4a09;hpb=f2d82acacff4126511c6d8c54c7187181f4f9a95;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/effects/shader-effect-impl.h b/dali/internal/event/effects/shader-effect-impl.h index 2ccc768..0ee4e07 100644 --- a/dali/internal/event/effects/shader-effect-impl.h +++ b/dali/internal/event/effects/shader-effect-impl.h @@ -20,11 +20,11 @@ // INTERNAL INCLUDES #include -#include +#include +#include #include #include -#include -#include +#include namespace Dali { @@ -32,11 +32,6 @@ namespace Dali namespace Internal { -namespace SceneGraph -{ -class UpdateManager; -} - /** * An abstract base class for a shader effect object. * The corresponding scene-graph object is a collection of shader programs, @@ -47,12 +42,6 @@ class ShaderEffect : public Object public: typedef Dali::ShaderEffect::UniformCoordinateType UniformCoordinateType; - enum GeometryState - { - DOESNT_MODIFY_GEOMETRY, - MODIFIES_GEOMETRY - }; - /** * Create a new ShaderEffect with no programs * @param hints GeometryHints to define the geometry of the rendered object @@ -93,27 +82,124 @@ public: const std::string& vertexSource, const std::string& fragmentSource ); /** - * Send shader program to scene-graph object. - * @param[in] vertexSource The source code for the vertex shader - * @param[in] fragmentSource The source code for the fragment shader - * @param[in] modifiesGeometry True if the shader modifies geometry + * @brief Notify ShaderEffect that it's being used by an Actor. + * + * @param[in] actor The Actor that is connecting to this ShaderEffect */ - void SendProgramMessage( const std::string& vertexSource, const std::string& fragmentSource, - bool modifiesGeometry ); + void Connect( ActorPtr actor ); /** - * Notify ShaderEffect that it's being used by an Actor. + * @brief Notify ShaderEffect that an Actor is no longer using it. + * + * @param[in] actor The Actor that is disconnecting from this ShaderEffect */ - void Connect(); + void Disconnect( ActorPtr actor ); + +public: /** - * Notify ShaderEffect that an Actor is no longer using it. + * Returns the shader for this ShaderEffect + * + * @return Returns the shader for this ShaderEffect */ - void Disconnect(); + ShaderPtr GetShader() const { return mShader; } -public: // Default property extensions from Object + /** + * Returns the geometry grid size. + * + * @param[in] size The pixel area size. + * @return Returns the geometry grid size + */ + Vector2 GetGridSize( const Vector2& size ); /** + * Returns the effect image for this ShaderEffect + * + * @return Returns the effect image for this ShaderEffect + */ + Dali::Image GetEffectImage() const { return mEffectImage; } + +public: // override property functions from Object + + /** + * @copydoc Dali::Handle::GetPropertyCount() + */ + virtual unsigned int GetPropertyCount() const; + + /** + * @copydoc Dali::Handle::GetPropertyName() + */ + virtual std::string GetPropertyName( Property::Index index ) const; + + /** + * @copydoc Dali::Handle::GetPropertyIndex() + */ + virtual Property::Index GetPropertyIndex( const std::string& name ) const; + + /** + * @copydoc Dali::Handle::IsPropertyWritable() + */ + virtual bool IsPropertyWritable( Property::Index index ) const; + + /** + * @copydoc Dali::Handle::IsPropertyAnimatable() + */ + virtual bool IsPropertyAnimatable( Property::Index index ) const; + + /** + * @copydoc Dali::Handle::IsPropertyAConstraintInput() + */ + virtual bool IsPropertyAConstraintInput( Property::Index index ) const; + + /** + * @copydoc Dali::Handle::GetPropertyType() + */ + virtual Property::Type GetPropertyType( Property::Index index ) const; + + /** + * @copydoc Dali::Handle::SetProperty() + */ + virtual void SetProperty( Property::Index index, const Property::Value& propertyValue ); + + /** + * @copydoc Dali::Handle::GetProperty() + */ + virtual Property::Value GetProperty( Property::Index index ) const; + + /** + * @copydoc Dali::Handle::GetPropertyIndices() + */ + virtual void GetPropertyIndices( Property::IndexContainer& indices ) const; + + /** + * @copydoc Dali::Handle::RegisterProperty() + */ + virtual Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue ); + + /** + * @copydoc Dali::Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode) + */ + virtual Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode ); + + /** + * @copydoc Dali::Handle::AddPropertyNotification() + */ + virtual Dali::PropertyNotification AddPropertyNotification( Property::Index index, + int componentIndex, + const Dali::PropertyCondition& condition ); + + /** + * @copydoc Dali::Handle::RemovePropertyNotification() + */ + virtual void RemovePropertyNotification( Dali::PropertyNotification propertyNotification ); + + /** + * @copydoc Dali::Handle::RemovePropertyNotifications() + */ + virtual void RemovePropertyNotifications(); + +public: // Default property extensions from Object + /** * @copydoc Dali::Internal::Object::GetDefaultPropertyCount() */ virtual unsigned int GetDefaultPropertyCount() const; @@ -164,11 +250,6 @@ public: // Default property extensions from Object virtual Property::Value GetDefaultProperty( Property::Index index ) const; /** - * @copydoc Dali::Internal::Object::NotifyScenePropertyInstalled() - */ - virtual void NotifyScenePropertyInstalled( const SceneGraph::PropertyBase& newProperty, const std::string& name, unsigned int index ) const; - - /** * @copydoc Dali::Internal::Object::GetSceneObject() */ virtual const SceneGraph::PropertyOwner* GetSceneObject() const; @@ -183,14 +264,18 @@ public: // Default property extensions from Object */ virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const; + /** + * @copydoc Dali::Internal::Object::GetPropertyComponentIndex() + */ + virtual int GetPropertyComponentIndex( Property::Index index ) const; + protected: /** * Protected constructor. - * @param[in] eventThreadServices the interface to use for sending messages to the update thread * @param[in] hints Geometry hints */ - ShaderEffect( EventThreadServices& eventThreadServices, Dali::ShaderEffect::GeometryHints hints ); + ShaderEffect( Dali::ShaderEffect::GeometryHints hints ); /** * A reference counted object may only be deleted by calling Unreference() @@ -204,12 +289,11 @@ private: ShaderEffect& operator=( const ShaderEffect& rhs ); private: // Data - EventThreadServices& mEventThreadServices; ///< Event thread services, for sending messages - SceneGraph::Shader* mSceneObject; ///< pointer to the scene shader, should not be changed on this thread - Dali::Image mImage; ///< Client-side handle for the effect image - unsigned int mConnectionCount; ///< number of on-stage ImageActors using this shader effect - Dali::ShaderEffect::GeometryHints mGeometryHints; ///< shader geometry hints for building the geometry - Dali::Vector< UniformCoordinateType > mCoordinateTypes; ///< cached to avoid sending tons of unnecessary messages + std::vector< ActorPtr > mConnectedActors; ///< The array of actors that are currently connected to this ShaderEffect + ShaderPtr mShader; ///< The shader pointer + Dali::Image mEffectImage; ///< The Client-side handle to the effect image + float mGridDensity; ///< The grid denisty + Dali::ShaderEffect::GeometryHints mGeometryHints; ///< shader geometry hints for building the geometry };