Ensure BaseHandle class move noexcept (core public-api)
[platform/core/uifw/dali-core.git] / dali / public-api / render-tasks / render-task.h
index 5d85da4..683a97e 100644 (file)
@@ -48,7 +48,7 @@ class RenderTask;
 /**
  * @brief RenderTasks describe how the Dali scene should be rendered.
  *
- * The Stage::GetRenderTaskList() method provides access to an ordered list of render-tasks.
+ * The Scene provides access to an ordered list of render-tasks.
  *
  * Each RenderTask must specify the source actors to be rendered, and a camera actor from
  * which the scene is viewed.
@@ -87,7 +87,6 @@ class RenderTask;
 class DALI_CORE_API RenderTask : public Handle
 {
 public:
-
   /**
    * @brief Enumeration for instances of properties belonging to the RenderTask class.
    * @SINCE_1_0.0
@@ -131,7 +130,7 @@ public:
    * @brief Typedef for signals sent by this class.
    * @SINCE_1_0.0
    */
-  typedef Signal< void (RenderTask& source) > RenderTaskSignalType;
+  using RenderTaskSignalType = Signal<void(RenderTask&)>;
 
   /**
    * @brief A pointer to a function for converting screen to frame-buffer coordinates.
@@ -139,7 +138,7 @@ public:
    * @param[in,out] coordinates The screen coordinates to convert where (0,0) is the top-left of the screen
    * @return True if the conversion was successful, otherwise coordinates should be unmodified
    */
-  typedef bool (* ScreenToFrameBufferFunction)( Vector2& coordinates );
+  using ScreenToFrameBufferFunction = bool (*)(Vector2&);
 
   /**
    * @brief A pointer to a function for converting screen to frame-buffer coordinates.
@@ -147,7 +146,7 @@ public:
    * @param[in,out] coordinates The screen coordinates to convert where (0,0) is the top-left of the screen
    * @return True if the conversion was successful, otherwise coordinates should be unmodified
    */
-  typedef bool (* const ConstScreenToFrameBufferFunction)( Vector2& coordinates );
+  using ConstScreenToFrameBufferFunction = bool (*const)(Vector2&);
 
   /**
    * @brief The default conversion function returns false for any screen coordinates.
@@ -198,7 +197,7 @@ public:
    * @param[in] handle A handle to an object
    * @return A handle to a RenderTask or an uninitialized handle
    */
-  static RenderTask DownCast( BaseHandle handle );
+  static RenderTask DownCast(BaseHandle handle);
 
   /**
    * @brief Destructor.
@@ -231,7 +230,7 @@ public:
    * @SINCE_1_9.22
    * @param[in] rhs A reference to the moved handle
    */
-  RenderTask( RenderTask&& rhs );
+  RenderTask(RenderTask&& rhs) noexcept;
 
   /**
    * @brief Move assignment operator.
@@ -240,7 +239,7 @@ public:
    * @param[in] rhs A reference to the moved handle
    * @return A reference to this
    */
-  RenderTask& operator=( RenderTask&& rhs );
+  RenderTask& operator=(RenderTask&& rhs) noexcept;
 
   /**
    * @brief Sets the actors to be rendered.
@@ -248,7 +247,7 @@ public:
    * @param[in] actor This actor and its children will be rendered.
    * If actor is an empty handle, then nothing will be rendered
    */
-  void SetSourceActor( Actor actor );
+  void SetSourceActor(Actor actor);
 
   /**
    * @brief Retrieves the actors to be rendered.
@@ -262,7 +261,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] exclusive True if the source actors will only be rendered by this render-task
    */
-  void SetExclusive( bool exclusive );
+  void SetExclusive(bool exclusive);
 
   /**
    * @brief Queries whether the RenderTask has exclusive access to the source actors.
@@ -281,7 +280,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] enabled True if the render-task should be considered for input handling
    */
-  void SetInputEnabled( bool enabled );
+  void SetInputEnabled(bool enabled);
 
   /**
    * @brief Queries whether the render-task should be considered for input handling.
@@ -295,7 +294,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] cameraActor The scene is viewed from the perspective of this actor
    */
-  void SetCameraActor( CameraActor cameraActor );
+  void SetCameraActor(CameraActor cameraActor);
 
   /**
    * @brief Retrieves the actor from which the scene is viewed.
@@ -309,7 +308,7 @@ public:
    * @SINCE_1_1.38
    * @param[in] frameBuffer A valid FrameBuffer handle to enable off-screen rendering, or an uninitialized handle to disable it
    */
-  void SetFrameBuffer( FrameBuffer frameBuffer );
+  void SetFrameBuffer(FrameBuffer frameBuffer);
 
   /**
    * @brief Retrieves the frame-buffer used as a render target.
@@ -325,7 +324,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] conversionFunction The conversion function
    */
-  void SetScreenToFrameBufferFunction( ScreenToFrameBufferFunction conversionFunction );
+  void SetScreenToFrameBufferFunction(ScreenToFrameBufferFunction conversionFunction);
 
   /**
    * @brief Retrieves the function used to convert screen coordinates to frame-buffer coordinates.
@@ -343,7 +342,7 @@ public:
    * @param[in] mappingActor The actor used for conversion
    * @note The mapping actor needs to be rendered by the default render task to make the mapping work properly.
    */
-  void SetScreenToFrameBufferMappingActor( Actor mappingActor );
+  void SetScreenToFrameBufferMappingActor(Actor mappingActor);
 
   /**
    * @brief Retrieves the actor used to convert screen coordinates to frame-buffer coordinates.
@@ -353,6 +352,30 @@ public:
   Actor GetScreenToFrameBufferMappingActor() const;
 
   /**
+   * @brief Sets the actor to compute viewport of this render task.
+   * Actor should be added on Scene.
+   * @SINCE_2_1.36
+   * @param[in] actor This actor is used to compute viewport of the render task.
+   * @note If window default camera is rotated and the actor is no longer a rectangle on the screen, Viewport may be computed incorrectly.
+   * The Viewport properties VIEWPORT_POSITION and VIEWPORT_SIZE is kept during using ViewportGuideActor, but only current value is changed.
+   */
+  void SetViewportGuideActor(Actor actor);
+
+  /**
+   * @brief Retrieves the actor to compute viewport of this render task.
+   * @SINCE_2_1.36
+   * @return This actor is used to compute viewport of the render task.
+   */
+  Actor GetViewportGuideActor() const;
+
+  /**
+   * @brief Resets the actor to compute viewport of this render task.
+   * @SINCE_2_1.36
+   * @note The Viewport properties VIEWPORT_POSITION and VIEWPORT_SIZE is still kept.
+   */
+  void ResetViewportGuideActor();
+
+  /**
    * @brief Sets the GL viewport position used when rendering.
    *
    * This specifies the transformation between normalized device coordinates and target window (or frame-buffer) coordinates.
@@ -361,7 +384,7 @@ public:
    * @param[in] position The viewports position (x,y)
    * @note Unlike the glViewport method, the x & y coordinates refer to the top-left of the viewport rectangle.
    */
-  void SetViewportPosition( Vector2 position );
+  void SetViewportPosition(Vector2 position);
 
   /**
    * @brief Retrieves the GL viewport position used when rendering.
@@ -378,7 +401,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] size The viewports size (width,height)
    */
-  void SetViewportSize( Vector2 size );
+  void SetViewportSize(Vector2 size);
 
   /**
    * @brief Retrieves the GL viewport size used when rendering.
@@ -396,7 +419,7 @@ public:
    * @param[in] viewport The new viewport
    * @note Unlike the glViewport method, the x & y coordinates refer to the top-left of the viewport rectangle.
    */
-  void SetViewport( Viewport viewport );
+  void SetViewport(Viewport viewport);
 
   /**
    * @brief Retrieves the GL viewport used when rendering.
@@ -410,7 +433,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] color The new clear color
    */
-  void SetClearColor( const Vector4& color );
+  void SetClearColor(const Vector4& color);
 
   /**
    * @brief Retrieves the clear color used when SetClearEnabled(true) is used.
@@ -433,7 +456,7 @@ public:
    * be (partially) cleared before rendering the second.
    *
    */
-  void SetClearEnabled( bool enabled );
+  void SetClearEnabled(bool enabled);
 
   /**
    * @brief Queries whether the render-task will clear the results of previous render-tasks.
@@ -451,7 +474,7 @@ public:
    * @note If the shader uses @ref Shader::Hint::MODIFIES_GEOMETRY then culling optimizations are disabled.
    * @see Shader::Hint
    */
-  void SetCullMode( bool cullMode );
+  void SetCullMode(bool cullMode);
 
   /**
    * @brief Gets the cull mode.
@@ -479,7 +502,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] refreshRate The new refresh rate
    */
-  void SetRefreshRate( uint32_t refreshRate );
+  void SetRefreshRate(uint32_t refreshRate);
 
   /**
    * @brief Queries the refresh-rate of the RenderTask.
@@ -497,7 +520,7 @@ public:
    * @param[out] viewportY The viewport y position
    * @return true if the position has a screen coordinate
    */
-  bool WorldToViewport(const Vector3 &position, float& viewportX, float& viewportY) const;
+  bool WorldToViewport(const Vector3position, float& viewportX, float& viewportY) const;
 
   /**
    * @brief Gets actor local coordinates for given viewport coordinates.
@@ -510,10 +533,9 @@ public:
    * @param[out] localY The local y position
    * @return true if the screen position has a local coordinate
    */
-  bool ViewportToLocal(Actor actor, float viewportX, float viewportY, float &localX, float &localY) const;
+  bool ViewportToLocal(Actor actor, float viewportX, float viewportY, float& localX, float& localY) const;
 
 public: // Signals
-
   /**
    * @brief If the refresh rate is REFRESH_ONCE, connect to this signal to be notified when a RenderTask has finished.
    * @SINCE_1_0.0
@@ -522,14 +544,13 @@ public: // Signals
   RenderTaskSignalType& FinishedSignal();
 
 public: // Not intended for application developers
-
   /// @cond internal
   /**
    * @brief This constructor is used by Dali New() methods.
    * @SINCE_1_0.0
    * @param[in] renderTask A pointer to a newly allocated render-task
    */
-  explicit DALI_INTERNAL RenderTask( Internal::RenderTask* renderTask );
+  explicit DALI_INTERNAL RenderTask(Internal::RenderTask* renderTask);
   /// @endcond
 };