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 3d8f002..14ad9de 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 3ace87b..f42b85f 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 6a71e00..39aa172 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 db97cd5..d8b9be5 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 cbb290e..9e87551 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 ab267c2..0a6a018 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 5d2148f..63e023b 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 ) );
   }
 }