Revert "[Tizen] Fix screen rotation bug when application is initialized"
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 27 Jul 2020 06:18:28 +0000 (15:18 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 27 Jul 2020 06:18:33 +0000 (15:18 +0900)
This reverts commit 72395a9162b5c8295a6eae39b8be892ced6d4912.

Change-Id: I255ea75d51504d5b992f552535d6dcf3f6b6f878

dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-render-surface.cpp

index 1664ed3..dbf04f4 100755 (executable)
@@ -807,7 +807,6 @@ void Window::OnOutputTransformed()
   {
     forceUpdate = true;
   }
-  DALI_LOG_RELEASE_INFO( "Window (%p), WinId (%d), OnOutputTransformed()\n", this, mNativeWindowId );
   SurfaceResized( forceUpdate );
 
   PositionSize positionSize = mSurface->GetPositionSize();
index 4db576f..7e5808c 100644 (file)
@@ -106,6 +106,14 @@ void WindowRenderSurface::Initialize( Any surface )
 
   // Connect signals
   mWindowBase->OutputTransformedSignal().Connect( this, &WindowRenderSurface::OutputTransformed );
+
+  // Check screen rotation
+  mScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
+  if( mScreenRotationAngle != 0 )
+  {
+    mScreenRotationFinished = false;
+    mResizeFinished = false;
+  }
 }
 
 Any WindowRenderSurface::GetNativeWindow()
@@ -216,8 +224,20 @@ void WindowRenderSurface::CreateSurface()
 {
   DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
 
+  int width, height;
+  if( mScreenRotationAngle == 0 || mScreenRotationAngle == 180 )
+  {
+    width = mPositionSize.width;
+    height = mPositionSize.height;
+  }
+  else
+  {
+    width = mPositionSize.height;
+    height = mPositionSize.width;
+  }
+
   // Create the EGL window
-  EGLNativeWindowType window = mWindowBase->CreateEglWindow( mPositionSize.width, mPositionSize.height );
+  EGLNativeWindowType window = mWindowBase->CreateEglWindow( width, height );
 
   auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
 
@@ -558,11 +578,11 @@ void WindowRenderSurface::OutputTransformed()
 
     mOutputTransformedSignal.Emit();
 
-    DALI_LOG_RELEASE_INFO( "WindowRenderSurface::OutputTransformed: window = %d screen = %d\n", mRotationAngle, mScreenRotationAngle );
+    DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle );
   }
   else
   {
-    DALI_LOG_RELEASE_INFO( "WindowRenderSurface::OutputTransformed: Ignore output transform [%d]\n", mScreenRotationAngle );
+    DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: Ignore output transform [%d]\n", mScreenRotationAngle );
   }
 }