[Tizen] Add New API of Scene with screen orientation
[platform/core/uifw/dali-core.git] / dali / internal / event / common / scene-impl.h
old mode 100644 (file)
new mode 100755 (executable)
index c13f7f5..c84d4c6
@@ -44,6 +44,54 @@ namespace Internal
 namespace SceneGraph
 {
 class Scene;
+
+struct DirtyRect
+{
+  DirtyRect(Node* node, Render::Renderer* renderer, int frame, Rect<int>& rect)
+  : node(node),
+    renderer(renderer),
+    frame(frame),
+    rect(rect),
+    visited(true)
+  {
+  }
+
+  DirtyRect()
+  : node(nullptr),
+    renderer(nullptr),
+    frame(0),
+    rect(),
+    visited(true)
+  {
+  }
+
+  bool operator<(const DirtyRect& rhs) const
+  {
+    if (node == rhs.node)
+    {
+      if (renderer == rhs.renderer)
+      {
+        return frame > rhs.frame; // Most recent rects come first
+      }
+      else
+      {
+        return renderer < rhs.renderer;
+      }
+    }
+    else
+    {
+      return node < rhs.node;
+    }
+  }
+
+  Node* node;
+  Render::Renderer* renderer;
+  int frame;
+
+  Rect<int> rect;
+  bool visited;
+};
+
 }
 
 class EventProcessor;
@@ -69,6 +117,11 @@ public:
   static ScenePtr New( Size size );
 
   /**
+   * @copydoc Dali::Integration::Scene::New
+   */
+  static ScenePtr New( Size size, int orientation );
+
+  /**
    * virtual destructor
    */
   ~Scene() override;
@@ -262,6 +315,13 @@ public:
    */
   Integration::Scene::WheelEventSignalType& WheelEventSignal();
 
+  /**
+   * @brief Get ItemsDirtyRects
+   *
+   * @return the ItemsDirtyRects
+   */
+  std::vector<Dali::Internal::SceneGraph::DirtyRect>& GetItemsDirtyRects();
+
 public:
 
   /**
@@ -285,8 +345,9 @@ private:
    * Second-phase constructor.
    *
    * @param[in] size The size of the set surface
+   * @param[in] orientation The orientation of the set surface for this scene
    */
-  void Initialize( Size size );
+  void Initialize( Size size, int orientation );
 
   // Undefined
   Scene(const Scene&) = delete;
@@ -332,6 +393,8 @@ private:
 
   // The wheel event signal
   Integration::Scene::WheelEventSignalType mWheelEventSignal;
+
+  std::vector<Dali::Internal::SceneGraph::DirtyRect>                    mItemsDirtyRects;
 };
 
 } // Internal