Support multiple surfaces for partial update
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.cpp
index be1c3ad..a224207 100755 (executable)
@@ -178,12 +178,7 @@ void Window::Raise()
 {
   mWindowBase->Raise();
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 
   DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Raise() \n", this, mNativeWindowId );
 }
@@ -192,12 +187,7 @@ void Window::Lower()
 {
   mWindowBase->Lower();
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 
   DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Lower() \n", this, mNativeWindowId );
 }
@@ -206,12 +196,7 @@ void Window::Activate()
 {
   mWindowBase->Activate();
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 
   DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId );
 }
@@ -425,12 +410,7 @@ void Window::Show()
     mVisibilityChangedSignal.Emit( handle, true );
   }
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 
   DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
 }
@@ -450,14 +430,6 @@ void Window::Hide()
     mVisibilityChangedSignal.Emit( handle, false );
   }
 
-
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
-
   DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible );
 }
 
@@ -506,13 +478,6 @@ void Window::SetInputRegion( const Rect< int >& inputRegion )
 {
   mWindowBase->SetInputRegion( inputRegion );
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
-
   DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
 }
 
@@ -624,12 +589,7 @@ void Window::SetSize( Dali::Window::WindowSize size )
     mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
   }
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 }
 
 Dali::Window::WindowSize Window::GetSize() const
@@ -651,12 +611,7 @@ void Window::SetPosition( Dali::Window::WindowPosition position )
 
   mWindowSurface->MoveResize( PositionSize( position.GetX(), position.GetY(), oldRect.width, oldRect.height ) );
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 }
 
 Dali::Window::WindowPosition Window::GetPosition() const
@@ -695,12 +650,7 @@ void Window::SetPositionSize( PositionSize positionSize )
     mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
   }
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 }
 
 Dali::Layer Window::GetRootLayer() const
@@ -766,12 +716,7 @@ void Window::OnIconifyChanged( bool iconified )
     DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible );
   }
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 }
 
 void Window::OnFocusChanged( bool focusIn )
@@ -779,12 +724,7 @@ void Window::OnFocusChanged( bool focusIn )
   Dali::Window handle( this );
   mFocusChangeSignal.Emit( handle, focusIn );
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 }
 
 void Window::OnOutputTransformed()
@@ -856,13 +796,6 @@ void Window::OnPause()
   {
     mEventHandler->Pause();
   }
-
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
 }
 
 void Window::OnResume()
@@ -872,12 +805,7 @@ void Window::OnResume()
     mEventHandler->Resume();
   }
 
-  GraphicsInterface& graphics = mAdaptor->GetGraphicsInterface();
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(&graphics);
-  if (eglGraphics)
-  {
-    eglGraphics->SetFullSwapNextFrame();
-  }
+  mSurface->SetFullSwapNextFrame();
 }
 
 void Window::RecalculateTouchPosition( Integration::Point& point )