[Tizen] Add codes for Dali Windows Backend
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / combined-update-render-controller.cpp
old mode 100644 (file)
new mode 100755 (executable)
index a73104a..5ae0ecc
@@ -28,7 +28,9 @@
 #include <dali/internal/system/common/environment-options.h>
 #include <dali/internal/system/common/time-service.h>
 #include <dali/internal/adaptor/common/adaptor-internal-services.h>
+#if defined(__GNUC__)
 #include <dali/devel-api/adaptor-framework/thread-settings.h>
+#endif
 
 namespace Dali
 {
@@ -397,7 +399,9 @@ void CombinedUpdateRenderController::ProcessSleepRequest()
 
 void CombinedUpdateRenderController::UpdateRenderThread()
 {
+#if defined(__GNUC__)
   SetThreadName("RenderThread\0");
+#endif
 
   // Install a function for logging
   mEnvironmentOptions.InstallLogFunction();
@@ -469,6 +473,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       // If the new surface has a different display connection, then the context will be lost
 
       mAdaptorInterfaces.GetDisplayConnectionInterface().Initialize();
+      newSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
       newSurface->ReplaceGraphicsSurface();
       SurfaceReplaced();
     }
@@ -515,13 +520,15 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     }
 
     // Check resize
-    bool surfaceResized = ShouldSurfaceBeResized();
-    if( DALI_UNLIKELY( surfaceResized ) )
+    bool surfaceResized = false;
+    bool shouldSurfaceBeResized = ShouldSurfaceBeResized();
+    if( DALI_UNLIKELY( shouldSurfaceBeResized ) )
     {
       if( updateStatus.SurfaceRectChanged() )
       {
         LOG_UPDATE_RENDER_TRACE_FMT( "Resizing Surface" );
         SurfaceResized();
+        surfaceResized = true;
       }
     }
 
@@ -544,10 +551,10 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       }
     }
 
-    RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+    currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
     if( currentSurface )
     {
-      currentSurface->PreRender( mSurfaceResized );
+      currentSurface->PreRender( surfaceResized );
     }
 
     Integration::RenderStatus renderStatus;
@@ -562,7 +569,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     {
       if( currentSurface )
       {
-        currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), mSurfaceResized );
+        currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), surfaceResized );
       }
     }
 
@@ -624,6 +631,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   // Inform core of context destruction & shutdown EGL
   mCore.ContextDestroyed();
+  currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
   if( currentSurface )
   {
     currentSurface->DestroySurface();