[Tizen] Fix window rotation sync issue for mulit window 17/223917/2
authorWonsik Jung <sidein@samsung.com>
Wed, 5 Feb 2020 04:42:45 +0000 (13:42 +0900)
committerWonsik Jung <sidein@samsung.com>
Wed, 5 Feb 2020 05:33:59 +0000 (14:33 +0900)
Fix window rotation sync issue for multi window
Rotation_done_send() should be called after eglSwapbuffers.
For the sync, this patch has the connection of thread controller's lock.

Change-Id: Ice2575a6e86e2de80b816f6776afe9e3de7272ea

dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/adaptor/common/combined-update-render-controller.h
dali/internal/adaptor/common/thread-controller-interface.h
dali/internal/system/common/thread-controller.cpp
dali/internal/system/common/thread-controller.h

index 695688f..4d0dc84 100755 (executable)
@@ -649,6 +649,10 @@ bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std::
   // Add the new Window to the container - the order is not important
   mWindows.push_back( &windowImpl );
 
+  Dali::RenderSurfaceInterface* surface = windowImpl.GetSurface();
+
+  mThreadController->AddSurface( surface );
+
   mWindowCreatedSignal.Emit( childWindow );
 
   return true;
index b3cef0d..798faf1 100644 (file)
@@ -381,6 +381,17 @@ void CombinedUpdateRenderController::SetPreRenderCallback( CallbackBase* callbac
   mPreRenderCallback = callback;
 }
 
+void CombinedUpdateRenderController::AddSurface( Dali::RenderSurfaceInterface* surface )
+{
+  LOG_EVENT_TRACE;
+  LOG_EVENT( "Surface is added" );
+  if( mUpdateRenderThread )
+  {
+    // Set the ThreadSyncronizationInterface on the added surface
+    surface->SetThreadSynchronization( *this );
+  }
+}
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // EVENT THREAD
 ///////////////////////////////////////////////////////////////////////////////////////////////////
index 571485b..65c262f 100644 (file)
@@ -145,6 +145,11 @@ public:
    */
   void SetPreRenderCallback( CallbackBase* callback ) override;
 
+  /**
+   * @copydoc ThreadControllerInterface::AddSurface()
+   */
+  virtual void AddSurface( Dali::RenderSurfaceInterface* surface );
+
 private:
 
   // Undefined copy constructor.
index 8c63c7d..41160fc 100644 (file)
@@ -113,6 +113,12 @@ public:
    */
   virtual void SetPreRenderCallback( CallbackBase* callback ) = 0;
 
+  /**
+   * @brief Adds the new surface.
+   * @param surface new surface
+   */
+  virtual void AddSurface( Dali::RenderSurfaceInterface* surface ) = 0;
+
 protected:
 
   /**
index cd6671d..cff4b45 100644 (file)
@@ -110,6 +110,11 @@ void ThreadController::SetPreRenderCallback( CallbackBase* callback )
   mThreadControllerInterface->SetPreRenderCallback( callback );
 }
 
+void ThreadController::AddSurface( Dali::RenderSurfaceInterface* newSurface )
+{
+  mThreadControllerInterface->AddSurface( newSurface );
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 686c653..b092bc1 100644 (file)
@@ -132,6 +132,13 @@ public:
    */
   void SetPreRenderCallback( CallbackBase* callback );
 
+  /**
+   * @brief Adds the new surface.
+   *
+   * @param surface new surface
+   */
+  void AddSurface( Dali::RenderSurfaceInterface* surface );
+
 private:
 
   // Undefined copy constructor.