Fix window rotation sync issue for mulit window 34/224334/1
authorWonsik Jung <sidein@samsung.com>
Wed, 5 Feb 2020 04:42:45 +0000 (13:42 +0900)
committerWonsik Jung <sidein@samsung.com>
Mon, 10 Feb 2020 02:26:49 +0000 (11:26 +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 ce8863c..d00a607 100755 (executable)
@@ -626,6 +626,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 4b794ce..a41a613 100644 (file)
@@ -399,6 +399,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 03e511e..edaf83c 100644 (file)
@@ -151,6 +151,11 @@ public:
    */
   void SetPreRenderCallback( CallbackBase* callback ) override;
 
+  /**
+   * @copydoc ThreadControllerInterface::AddSurface()
+   */
+  virtual void AddSurface( Dali::RenderSurfaceInterface* surface );
+
 private:
 
   // Undefined copy constructor.
index 99317d6..6b9055b 100644 (file)
@@ -118,6 +118,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 fbe90dc..a9054ec 100644 (file)
@@ -115,6 +115,11 @@ void ThreadController::SetPreRenderCallback( CallbackBase* callback )
   mThreadControllerInterface->SetPreRenderCallback( callback );
 }
 
+void ThreadController::AddSurface( Dali::RenderSurfaceInterface* newSurface )
+{
+  mThreadControllerInterface->AddSurface( newSurface );
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index e1f1c84..c4f3961 100644 (file)
@@ -137,6 +137,13 @@ public:
    */
   void SetPreRenderCallback( CallbackBase* callback );
 
+  /**
+   * @brief Adds the new surface.
+   *
+   * @param surface new surface
+   */
+  void AddSurface( Dali::RenderSurfaceInterface* surface );
+
 private:
 
   // Undefined copy constructor.