[Tizen] Fix the sync issue of window rotation.
[platform/core/uifw/dali-core.git] / dali / internal / update / common / scene-graph-scene.h
index 89d4da1..640189b 100644 (file)
@@ -115,6 +115,22 @@ public:
    */
   void GetFramePresentedCallback( Dali::Integration::Scene::FrameCallbackContainer& callbacks );
 
+  /**
+   * Set the surface orientation when surface is rotated.
+   *
+   * @param[in] scene The rotated scene.
+   * @param[in] orientation The orientation value representing the surface.
+   */
+  void SetSurfaceOrientation( int orientation );
+
+  /**
+   * Get the surface orientation.
+   *
+   * @param[in] scene The rotated scene.
+   * @return the current surface orientation
+   */
+  int GetSurfaceOrientation() const;
+
 private:
 
   Context*                    mContext;   ///< The context holding the GL state of rendering for the scene, not owned
@@ -126,12 +142,14 @@ private:
 
   Dali::Integration::Scene::FrameCallbackContainer mFrameRenderedCallbacks;   ///< Frame rendered callbacks
   Dali::Integration::Scene::FrameCallbackContainer mFramePresentedCallbacks;  ///< Frame presented callbacks
+
+  int                         mSurfaceOrientation;
 };
 
 /// Messages
 inline void AddFrameRenderedCallbackMessage( EventThreadServices& eventThreadServices, const Scene& scene, const CallbackBase* callback, int32_t frameId )
 {
-  typedef MessageValue2< Scene, CallbackBase*, int32_t > LocalType;
+  using LocalType = MessageValue2<Scene, CallbackBase*, int32_t>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -142,7 +160,7 @@ inline void AddFrameRenderedCallbackMessage( EventThreadServices& eventThreadSer
 
 inline void AddFramePresentedCallbackMessage( EventThreadServices& eventThreadServices, const Scene& scene, const CallbackBase* callback, int32_t frameId )
 {
-  typedef MessageValue2< Scene, CallbackBase*, int32_t > LocalType;
+  using LocalType = MessageValue2<Scene, CallbackBase*, int32_t>;
 
   // Reserve some memory inside the message queue
   uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
@@ -151,6 +169,17 @@ inline void AddFramePresentedCallbackMessage( EventThreadServices& eventThreadSe
   new (slot) LocalType( &scene, &Scene::AddFramePresentedCallback, const_cast< CallbackBase* >( callback ), frameId );
 }
 
+inline void SetSurfaceOrientationMessage( EventThreadServices& eventThreadServices, const Scene& scene, int orientation )
+{
+  using LocalType = MessageValue1<Scene, int>;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &scene, &Scene::SetSurfaceOrientation, orientation );
+}
+
 } // namespace SceneGraph
 
 } // namespace Internal