Use modern construct 'using' instead of typedef.
[platform/core/uifw/dali-core.git] / dali / internal / event / rendering / sampler-impl.h
index 340f140..93fab94 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SAMPLER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/actors/sampling.h>
 #include <dali/public-api/common/dali-common.h> // DALI_ASSERT_ALWAYS
 #include <dali/public-api/common/intrusive-ptr.h> // Dali::IntrusivePtr
-#include <dali/devel-api/rendering/sampler.h> // Dali::Sampler
+#include <dali/public-api/rendering/sampler.h> // Dali::Sampler
 #include <dali/internal/event/common/connectable.h> // Dali::Internal::Connectable
 #include <dali/internal/event/common/object-connector.h> // Dali::Internal::ObjectConnector
 #include <dali/internal/event/common/object-impl.h> // Dali::Internal::Object
-#include <dali/internal/event/images/image-connector.h> // Dali::Internal::ImageConnector
 
 namespace Dali
 {
 namespace Internal
 {
-namespace SceneGraph
+namespace Render
 {
-class Sampler;
+struct Sampler;
 }
 
 class Sampler;
-typedef IntrusivePtr<Sampler> SamplerPtr;
+using SamplerPtr = IntrusivePtr<Sampler>;
 
 /**
  * Sampler is an object that contains an array of structures of values that
  * can be accessed as properties.
  */
-class Sampler : public Object, public Connectable
+class Sampler : public BaseObject
 {
 public:
 
@@ -51,142 +51,24 @@ public:
    * Create a new Sampler.
    * @return A smart-pointer to the newly allocated Sampler.
    */
-  static SamplerPtr New( const std::string& textureUnitUniformName );
-
-  /**
-   * @copydoc Dali::Sampler::SetUniformName()
-   */
-  void SetTextureUnitUniformName( const std::string& name );
-
-  /**
-   * @copydoc Dali::Sampler::SetImage()
-   */
-  void SetImage( ImagePtr& image );
-
-  /**
-   * @copydoc Dali::Sampler::GetImage()
-   */
-  ImagePtr GetImage() const;
+  static SamplerPtr New( );
 
   /**
    * @copydoc Dali::Sampler::SetFilterMode()
    */
-  void SetFilterMode( Dali::Sampler::FilterMode minFilter, Dali::Sampler::FilterMode magFilter );
+  void SetFilterMode( Dali::FilterMode::Type minFilter, Dali::FilterMode::Type magFilter );
 
   /**
    * @copydoc Dali::Sampler::SetWrapMode()
    */
-  void SetWrapMode( Dali::Sampler::WrapMode uWrap, Dali::Sampler::WrapMode vWrap );
+  void SetWrapMode( Dali::WrapMode::Type rWrap, Dali::WrapMode::Type sWrap, Dali::WrapMode::Type tWrap );
 
   /**
-   * @copydoc Dali::Sampler::SetAffectsTransparency()
-   */
-  void SetAffectsTransparency( bool affectsTransparency );
-
-  /**
-   * @brief Get the sampler scene object
+   * Get the render thread sampler
    *
-   * @return the sampler scene object
-   */
-  const SceneGraph::Sampler* GetSamplerSceneObject() const;
-
-public: // Default property extensions from Object
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::SetDefaultProperty()
-   */
-  virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
-
-  /**
-   * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
-   */
-  virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultProperty()
-   */
-  virtual Property::Value GetDefaultProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetPropertyOwner()
-   */
-  virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
-   */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
-   */
-  virtual int GetPropertyComponentIndex( Property::Index index ) const;
-
-public: // Functions from Connectable
-  /**
-   * @copydoc Dali::Internal::Connectable::OnStage()
-   */
-  virtual bool OnStage() const;
-
-  /**
-   * @copydoc Dali::Internal::Connectable::Connect()
+   * @return The render thread sampler
    */
-  virtual void Connect();
-
-  /**
-   * @copydoc Dali::Internal::Connectable::Disconnect()
-   */
-  virtual void Disconnect();
+  Render::Sampler* GetSamplerRenderObject();
 
 private:
   Sampler();
@@ -194,7 +76,7 @@ private:
   /**
    * Second stage initialization
    */
-  void Initialize( const std::string& textureUnitUniformName );
+  void Initialize( );
 
 protected:
   /**
@@ -203,10 +85,9 @@ protected:
   virtual ~Sampler();
 
 private: // data
-  //TODO: MESH_REWORK : change to ObjectConnector
-  ImageConnector mImageConnector;
-  SceneGraph::Sampler* mSceneObject;
-  bool mOnStage;
+  EventThreadServices& mEventThreadServices;    ///<Used to send messages to the render thread via the update thread
+  Render::Sampler* mRenderObject;               ///<Render thread sampler for this sampler
+
 };
 
 } // namespace Internal