From b3fc921279faf27505f0a0638d14e2e61e00e228 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 9 Aug 2017 09:34:23 +0900 Subject: [PATCH] Cleanup screen rotation code Change-Id: I69f0a3c7d0212c69f710142532724d020ff6f35e --- adaptors/common/adaptor-impl.cpp | 4 ++-- adaptors/common/adaptor-impl.h | 7 +++++-- adaptors/ecore/wayland/window-impl-ecore-wl.cpp | 20 ++++++++++++++++---- .../ecore/wayland/window-render-surface-ecore-wl.cpp | 5 ----- adaptors/integration-api/adaptor.h | 3 --- adaptors/wayland/window-impl-wl.cpp | 4 ++-- adaptors/x11/window-impl-x.cpp | 8 ++++---- 7 files changed, 29 insertions(+), 22 deletions(-) diff --git a/adaptors/common/adaptor-impl.cpp b/adaptors/common/adaptor-impl.cpp index 3d8f002..14ad9de 100644 --- a/adaptors/common/adaptor-impl.cpp +++ b/adaptors/common/adaptor-impl.cpp @@ -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 diff --git a/adaptors/common/adaptor-impl.h b/adaptors/common/adaptor-impl.h index 3ace87b..f42b85f 100644 --- a/adaptors/common/adaptor-impl.h +++ b/adaptors/common/adaptor-impl.h @@ -23,6 +23,7 @@ #include #include #include +#include #include // 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 diff --git a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp index 6a71e00..39aa172 100644 --- a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp @@ -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 ) ); } } diff --git a/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp b/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp index db97cd5..d8b9be5 100644 --- a/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp @@ -19,10 +19,8 @@ #include // EXTERNAL INCLUDES -#include #include #include -#include // INTERNAL INCLUDES #include @@ -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; diff --git a/adaptors/integration-api/adaptor.h b/adaptors/integration-api/adaptor.h index cbb290e..9e87551 100644 --- a/adaptors/integration-api/adaptor.h +++ b/adaptors/integration-api/adaptor.h @@ -24,7 +24,6 @@ #include #include #include -#include // 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. diff --git a/adaptors/wayland/window-impl-wl.cpp b/adaptors/wayland/window-impl-wl.cpp index ab267c2..0a6a018 100644 --- a/adaptors/wayland/window-impl-wl.cpp +++ b/adaptors/wayland/window-impl-wl.cpp @@ -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 ) ); } } diff --git a/adaptors/x11/window-impl-x.cpp b/adaptors/x11/window-impl-x.cpp index 5d2148f..63e023b 100644 --- a/adaptors/x11/window-impl-x.cpp +++ b/adaptors/x11/window-impl-x.cpp @@ -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 ) ); } } -- 2.7.4