[Tizen] Implement partial update
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-render-surface.cpp
index 76bf702..e9288ca 100755 (executable)
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali/integration-api/trigger-event-factory-interface.h>
-#include <dali/integration-api/thread-synchronization-interface.h>
-#include <dali/internal/graphics/gles/egl-implementation.h>
+#include <dali/integration-api/adaptor-framework/thread-synchronization-interface.h>
+#include <dali/integration-api/adaptor-framework/trigger-event-factory-interface.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/adaptor/common/adaptor-internal-services.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
 #include <dali/internal/window-system/common/window-base.h>
 #include <dali/internal/window-system/common/window-factory.h>
 #include <dali/internal/window-system/common/window-system.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/system/common/environment-variables.h>
 
-
 namespace Dali
 {
 namespace Internal
@@ -256,10 +255,8 @@ void WindowRenderSurface::CreateSurface()
   // Check rotation capability
   mRotationSupported = mWindowBase->IsEglWindowRotationSupported();
 
-  int screenWidth, screenHeight;
-  WindowSystem::GetScreenSize( screenWidth, screenHeight );
-  DALI_LOG_RELEASE_INFO("WindowRenderSurface::CreateSurface: w = %d h = %d screenWidth = %d screenHeight = %d angle = %d screen rotation = %d\n",
-      mPositionSize.width, mPositionSize.height, screenWidth, screenHeight, mRotationAngle, mScreenRotationAngle );
+  DALI_LOG_RELEASE_INFO("WindowRenderSurface::CreateSurface: w = %d h = %d angle = %d screen rotation = %d\n",
+      mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle );
 }
 
 void WindowRenderSurface::DestroySurface()
@@ -415,7 +412,7 @@ bool WindowRenderSurface::PreRender( bool resizingSurface )
   return true;
 }
 
-std::vector<int32_t> WindowRenderSurface::MergeRect( Rect<int32_t> damagedRect, int bufferAge )
+std::vector<int32_t> WindowRenderSurface::MergeRect( const Rect<int32_t>& damagedRect, int bufferAge )
 {
   std::vector<int32_t> mergedRectArray;
   // merge bounding
@@ -459,11 +456,10 @@ std::vector<int32_t> WindowRenderSurface::MergeRect( Rect<int32_t> damagedRect,
 }
 
 
-Rect<int32_t> WindowRenderSurface::SetDamagedRect( Rect<int32_t> damagedRect )
+void WindowRenderSurface::SetDamagedRect( const Dali::DamagedRect& damagedRect, Dali::DamagedRect& mergedRect )
 {
   auto eglGraphics = static_cast<EglGraphics *>( mGraphics );
   std::vector<int32_t> rectArray;
-  Rect<int32_t> mergedDamagedRect;
   if( eglGraphics )
   {
     Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
@@ -481,18 +477,16 @@ Rect<int32_t> WindowRenderSurface::SetDamagedRect( Rect<int32_t> damagedRect )
 
   if( !rectArray.empty() )
   {
-    mergedDamagedRect.x = rectArray[0];
-    mergedDamagedRect.y = rectArray[1];
-    mergedDamagedRect.width = rectArray[2];
-    mergedDamagedRect.height = rectArray[3];
+    mergedRect.x = rectArray[0];
+    mergedRect.y = rectArray[1];
+    mergedRect.width = rectArray[2];
+    mergedRect.height = rectArray[3];
   }
-
-  return mergedDamagedRect;
 }
 
-int WindowRenderSurface::GetBufferAge()
+int32_t WindowRenderSurface::GetBufferAge()
 {
-  auto result = mBufferAge = 0;
+  int result = mBufferAge = 0;
   auto eglGraphics = static_cast<EglGraphics *>( mGraphics );
   if( eglGraphics )
   {