[Tizen] Add screen and client rotation itself function
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor-framework / render-surface-interface.h
index 25ad128..05b4c13 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/core-enumerations.h>
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/math/vector4.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/object/any.h>
+#include <dali/public-api/object/weak-handle.h>
+#include <dali/integration-api/scene.h>
+#include <dali/public-api/math/uint-16-pair.h>
 
 namespace Dali
 {
@@ -42,7 +46,8 @@ class GraphicsInterface;
 /**
  * @brief The position and size of the render surface.
  */
-typedef Dali::Rect<int> PositionSize;
+using PositionSize =  Dali::Rect<int>;
+using SurfaceSize = Uint16Pair;
 
 /**
  * @brief Interface for a render surface onto which Dali draws.
@@ -76,6 +81,7 @@ public:
   : mAdaptor( nullptr ),
     mGraphics( nullptr ),
     mDisplayConnection( nullptr ),
+    mScene(),
     mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ),
     mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE )
   {}
@@ -100,6 +106,12 @@ public:
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
 
   /**
+   * @brief Return the orientation of the surface.
+   * @return The orientation
+   */
+  virtual int GetOrientation() const = 0;
+
+  /**
    * @brief InitializeGraphics the platform specific graphics surface interfaces
    */
   virtual void InitializeGraphics() = 0;
@@ -136,9 +148,10 @@ public:
    * If the operation fails, then Core::Render should not be called until there is
    * a surface to render onto.
    * @param[in] resizingSurface True if the surface is being resized
+   * @param[in] damagedRects List of damaged rects this render pass
    * @return True if the operation is successful, False if the operation failed
    */
-  virtual bool PreRender( bool resizingSurface ) = 0;
+  virtual bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) = 0;
 
   /**
    * @brief Invoked by render thread after Core::Render
@@ -146,7 +159,8 @@ public:
    * @param[in] replacingSurface True if the surface is being replaced.
    * @param[in] resizingSurface True if the surface is being resized.
    */
-  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) = 0;
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) = 0;
+
   /**
    * @brief Invoked by render thread when the thread should be stop
    */
@@ -203,6 +217,15 @@ public:
     mDisplayConnection = &displayConnection;
   }
 
+  /**
+   * @brief Sets a Scene that is rendered on this surface.
+   * @param scene The Scene object
+   */
+  void SetScene( Dali::Integration::Scene& scene )
+  {
+    mScene = scene;
+  }
+
 private:
 
   /**
@@ -220,6 +243,7 @@ protected:
   Dali::Internal::Adaptor::AdaptorInternalServices* mAdaptor;
   Dali::Internal::Adaptor::GraphicsInterface* mGraphics;
   Dali::DisplayConnection* mDisplayConnection;
+  WeakHandle< Dali::Integration::Scene > mScene;
 
 private: