[Tizen] Add screen and client rotation itself function
[platform/core/uifw/dali-core.git] / dali / internal / update / manager / update-manager.h
index 724f8bf..0954733 100644 (file)
@@ -98,9 +98,7 @@ struct NodeDepthPair
 
 struct NodeDepths
 {
-  NodeDepths()
-  {
-  }
+  NodeDepths() = default;
 
   void Add( SceneGraph::Node* node, uint32_t sortedDepth )
   {
@@ -146,7 +144,7 @@ public:
   /**
    * Destructor.
    */
-  virtual ~UpdateManager();
+  ~UpdateManager() override;
 
   // Node connection methods
 
@@ -337,7 +335,7 @@ public:
    * @brief Accept compiled shaders passed back on render thread for saving.
    * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
    */
-  virtual void SaveBinary( Internal::ShaderDataPtr shaderData );
+  void SaveBinary( Internal::ShaderDataPtr shaderData ) override;
 
   /**
    * @brief Set the destination for compiled shader binaries to be passed on to.
@@ -636,6 +634,12 @@ public:
   void SetDefaultSurfaceRect( const Rect<int>& rect );
 
   /**
+   * Set the default surface orientation.
+   * @param[in] orientation The orientation value representing the surface.
+   */
+  void SetDefaultSurfaceOrientation( int orientation );
+
+  /**
    * @copydoc Dali::Stage::KeepRendering()
    */
   void KeepRendering( float durationSeconds );
@@ -646,6 +650,14 @@ public:
   void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
 
   /**
+   * Request to render the current frame
+   * @note This is a temporary workaround (to be removed in the future) to request the rendering of
+   *       the current frame if the color or visibility of any actor is updated. It MUST NOT be used
+   *       for any other purposes.
+   */
+  void RequestRendering();
+
+  /**
    * Sets the depths of all layers.
    * @param layers The layers in depth order.
    * @param[in] rootLayer The root layer of the sorted layers.
@@ -711,8 +723,9 @@ private:
    * Perform animation updates
    * @param[in] bufferIndex to use
    * @param[in] elapsedSeconds time since last frame
+   * @return true if at least one animations is currently active or false otherwise
    */
-  void Animate( BufferIndex bufferIndex, float elapsedSeconds );
+  bool Animate( BufferIndex bufferIndex, float elapsedSeconds );
 
   /**
    * Applies constraints to CustomObjects
@@ -1088,6 +1101,17 @@ inline void SurfaceReplacedMessage( UpdateManager& manager, const SceneGraph::Sc
   new (slot) LocalType( &manager, &UpdateManager::SurfaceReplaced, &scene );
 }
 
+inline void SetDefaultSurfaceOrientationMessage( UpdateManager& manager, int orientation  )
+{
+  typedef MessageValue1< UpdateManager, int > LocalType;
+
+  // Reserve some memory inside the message queue
+  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceOrientation, orientation );
+}
+
 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
 {
   using LocalType = MessageValue1<UpdateManager, float>;
@@ -1110,6 +1134,17 @@ inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Ren
   new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
 }
 
+inline void RequestRenderingMessage( UpdateManager& manager )
+{
+  using LocalType = Message<UpdateManager>;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &UpdateManager::RequestRendering );
+}
+
 /**
  * Create a message for setting the depth of a layer
  * @param[in] manager The update manager
@@ -1328,14 +1363,12 @@ public:
   /**
    * Virtual destructor
    */
-  virtual ~IndexBufferMessage()
-  {
-  }
+  ~IndexBufferMessage() override = default;
 
   /**
    * @copydoc MessageBase::Process
    */
-  virtual void Process( BufferIndex /*bufferIndex*/ )
+  void Process( BufferIndex /*bufferIndex*/ ) override
   {
     DALI_ASSERT_DEBUG( mManager && "Message does not have an object" );
     mManager->SetIndexBuffer( mRenderGeometry, mIndices );