Cleanup screen rotation code 38/143138/5
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 9 Aug 2017 00:34:23 +0000 (09:34 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Fri, 22 Sep 2017 01:38:10 +0000 (10:38 +0900)
Change-Id: I69f0a3c7d0212c69f710142532724d020ff6f35e

adaptors/common/adaptor-impl.cpp
adaptors/common/adaptor-impl.h
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp
adaptors/integration-api/adaptor.h
adaptors/wayland/window-impl-wl.cpp
adaptors/x11/window-impl-x.cpp

index 3d8f0025b1442eb7ca9124364900169b13ee32c4..14ad9de28646c4914ccd256ddac9496dee525ddd 100644 (file)
@@ -710,7 +710,7 @@ void Adaptor::OnDamaged( const DamageArea& area )
   RequestUpdate();
 }
 
-void Adaptor::SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
 {
   // let the core know the surface size has changed
   mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
@@ -718,7 +718,7 @@ void Adaptor::SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize )
   mResizedSignal.Emit( mAdaptor );
 }
 
-void Adaptor::SurfaceResizeComplete( Dali::Adaptor::SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizeComplete( SurfaceSize surfaceSize )
 {
   // flush the event queue to give the update-render thread chance
   // to start processing messages for new camera setup etc as soon as possible
index 3ace87bbcbe9c31264d090a5785ff61e74e32af1..f42b85f3944ccb378dbd63db6c84c74d190e77f1 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/common/view-mode.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/signals/callback.h>
+#include <dali/public-api/math/uint-16-pair.h>
 #include <dali/integration-api/render-controller.h>
 
 // INTERNAL INCLUDES
@@ -90,6 +91,8 @@ public:
 
   typedef Dali::Adaptor::AdaptorSignalType AdaptorSignalType;
 
+  typedef Uint16Pair SurfaceSize;          ///< Surface size type
+
   /**
    * Creates a New Adaptor
    * @param[in]  nativeWindow        Native window handle
@@ -338,12 +341,12 @@ public:
   /**
    * Informs core the surface size has changed
    */
-  void SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize );
+  void SurfaceResizePrepare( SurfaceSize surfaceSize );
 
   /**
    * Informs ThreadController the surface size has changed
    */
-  void SurfaceResizeComplete( Dali::Adaptor::SurfaceSize surfaceSize );
+  void SurfaceResizeComplete( SurfaceSize surfaceSize );
 
   /**
    * Sets layout direction of root by system language
index 6a71e003b8119bd39b1403f2ef57a232909f55e0..39aa172313c791e76f363f9ce452dc0cc94d0637 100644 (file)
@@ -210,10 +210,16 @@ struct Window::EventHandler
 
     if ( handler && handler->mWindow && transformEvent->output == ecore_wl_window_output_find( handler->mEcoreWindow ) )
     {
+      DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventOutputTransform\n", handler->mEcoreWindow );
+
       ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
       if( wlSurface )
       {
         wlSurface->OutputTransformed();
+
+        PositionSize positionSize = wlSurface->GetPositionSize();
+        handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+        handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
       }
     }
 
@@ -228,10 +234,16 @@ struct Window::EventHandler
 
     if ( handler && handler->mWindow && ignoreTransformEvent->win == handler->mEcoreWindow )
     {
+      DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventIgnoreOutputTransform\n", handler->mEcoreWindow );
+
       ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
       if( wlSurface )
       {
         wlSurface->OutputTransformed();
+
+        PositionSize positionSize = wlSurface->GetPositionSize();
+        handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+        handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
       }
     }
 
@@ -888,12 +900,12 @@ void Window::RotationDone( int orientation, int width, int height )
     wlSurface->RequestRotation( orientation, width, height );
   }
 
-  mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( width, height ) );
+  mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
 
   // Emit signal
   mResizedSignal.Emit( Dali::DevelWindow::WindowSize( width, height ) );
 
-  mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( width, height ) );
+  mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
 }
 
 unsigned int Window::GetSupportedAuxiliaryHintCount()
@@ -1425,12 +1437,12 @@ void Window::SetSize( Dali::DevelWindow::WindowSize size )
 
     mSurface->MoveResize( positionSize );
 
-    mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 
     // Emit signal
     mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
 
-    mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   }
 }
 
index db97cd5fe12a870921c2d9062d900e7d730617f9..d8b9be5cad4a71baba3798ef291e6c94377f3f23 100644 (file)
 #include <window-render-surface.h>
 
 // EXTERNAL INCLUDES
-#include <dlfcn.h>
 #include <dali/integration-api/gl-abstraction.h>
 #include <dali/integration-api/debug.h>
-#include <dali/integration-api/gl-defines.h>
 
 // INTERNAL INCLUDES
 #include <wl-types.h>
@@ -143,8 +141,6 @@ void WindowRenderSurface::OutputTransformed()
     transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mWlWindow ) );
   }
 
-  ecore_wl_window_buffer_transform_set( mWlWindow, transform );
-
   mScreenRotationAngle = transform * 90;
   mScreenRotationFinished = false;
 
@@ -458,7 +454,6 @@ void WindowRenderSurface::CreateWlRenderable()
     Ecore_Wl_Output* output = ecore_wl_window_output_find( mWlWindow );
 
     int transform = ecore_wl_output_transform_get( output );
-    ecore_wl_window_buffer_transform_set( mWlWindow, transform );
 
     mScreenRotationAngle = transform * 90;
     mScreenRotationFinished = false;
index cbb290e3577fbab4a7af34812076486b232aaf82..9e87551e252d245248175566b162dace48e9b211 100644 (file)
@@ -24,7 +24,6 @@
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/common/view-mode.h>
-#include <dali/public-api/math/uint-16-pair.h>
 
 // INTERNAL INCLUDES
 
@@ -115,8 +114,6 @@ public:
 
   typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals
 
-  typedef Uint16Pair SurfaceSize;          ///< Surface size type
-
 public:
   /**
    * @brief Create a new adaptor using the window.
index ab267c22bd91243b42e10d37dbbe2b25e83d5e8c..0a6a018d9d3a6b17c3c65937f0ed31c4a356a881 100644 (file)
@@ -418,12 +418,12 @@ void Window::SetSize( Dali::DevelWindow::WindowSize size )
 
     mSurface->MoveResize( positionSize );
 
-    mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 
     // Emit signal
     mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
 
-    mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   }
 }
 
index 5d2148facfa27ae813488a785b5db58347a58140..63e023b75976fc0c4d37ea7d81f1d96a03f9799e 100644 (file)
@@ -809,12 +809,12 @@ void Window::RotationDone( int orientation, int width, int height )
                                      ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
                                      ECORE_X_ATOM_CARDINAL, 32, &angles, 2 );
 
-    mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( width, height ) );
+    mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
 
     // Emit signal
     mResizedSignal.Emit( Dali::DevelWindow::WindowSize( width, height ) );
 
-    mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( width, height ) );
+    mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
 #endif // DALI_PROFILE_UBUNTU
   }
 }
@@ -919,12 +919,12 @@ void Window::SetSize( Dali::DevelWindow::WindowSize size )
 
     mSurface->MoveResize( positionSize );
 
-    mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 
     // Emit signal
     mResizedSignal.Emit( Dali::DevelWindow::WindowSize( positionSize.width, positionSize.height ) );
 
-    mAdaptor->SurfaceResizeComplete( Dali::Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+    mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
   }
 }