// Tell the core the size of the surface just before we start the render-thread
PositionSize size = mSurface->GetPositionSize();
- mCore->SurfaceResized( size.width, size.height );
+ int orientation = mSurface->GetOrientation();
+ bool forceUpdate = false;
+ if( mSurface->IsPreRotationSupported() )
+ {
+ orientation = 0;
+ forceUpdate = true;
+ }
+
+ mCore->SurfaceResized( size.width, size.height, orientation, forceUpdate );
// Initialize the thread controller
mThreadController->Initialize();
void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& surface )
{
PositionSize positionSize = surface.GetPositionSize();
+ int orientation = mSurface->GetOrientation();
+ bool forceUpdate = false;
+
+ if( mSurface->IsPreRotationSupported() )
+ {
+ orientation = 0;
+ forceUpdate = true;
+ }
// let the core know the surface size has changed
- mCore->SurfaceResized( positionSize.width, positionSize.height );
+ mCore->SurfaceResized( positionSize.width, positionSize.height, orientation, forceUpdate );
mResizedSignal.Emit( mAdaptor );
RequestUpdate( false );
}
-void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize, int orientation )
+void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize, int orientation, bool forceUpdate )
{
// let the core know the surface size and orientation has changed
- mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight(), orientation );
-
- mResizedSignal.Emit( mAdaptor );
-}
-
-void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
-{
- // let the core know the surface size has changed
- mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
+ mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight(), orientation, forceUpdate );
mResizedSignal.Emit( mAdaptor );
}
/**
* Informs core the surface size and orientation has changed
*/
- void SurfaceResizePrepare( SurfaceSize surfaceSize, int orientation );
-
- /**
- * Informs core the surface size has changed
- */
- void SurfaceResizePrepare( SurfaceSize surfaceSize );
+ void SurfaceResizePrepare( SurfaceSize surfaceSize, int orientation, bool forceUpdate );
/**
* Informs ThreadController the surface size has changed
virtual PositionSize GetPositionSize() const = 0;
/**
+ * @brief Return the orientation of the surface.
+ * @return The orientation
+ */
+ virtual int GetOrientation() const = 0;
+
+ /**
+ * Query wheter PreRotation is supported or not.
+ * @return true if the PreRotation is supported.
+ */
+ virtual bool IsPreRotationSupported() const = 0;
+
+ /**
* Initialize EGL, RenderSurface should create egl display and initialize
* @param egl implementation to use for the creation
*/
return mPositionSize;
}
+int EcoreWlRenderSurface::GetOrientation() const
+{
+ return 0;
+}
+
+bool EcoreWlRenderSurface::IsPreRotationSupported() const
+{
+ return false;
+}
+
void EcoreWlRenderSurface::MoveResize( Dali::PositionSize positionSize )
{
// nothing to do in base class
if ( handler && handler->mWindow && transformEvent->output == ecore_wl_window_output_find( handler->mEcoreWindow ) )
{
- DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform\n", handler->mEcoreWindow );
-
ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
if( wlSurface )
{
- int orientation = wlSurface->OutputTransformed();
+ wlSurface->OutputTransformed();
+
+ bool forceUpdate = false;
+ int orientation = wlSurface->GetOrientation();
+
+ // If PreRotation is supported, don't work client rotation by core.
+ // Client rotation means both window resize and camera rotation.
+ if( wlSurface->IsPreRotationSupported() )
+ {
+ forceUpdate = true;
+ orientation = 0;
+ }
PositionSize positionSize = wlSurface->GetPositionSize();
- handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation );
+ handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation, forceUpdate );
handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform [%d, %d]\n", handler->mEcoreWindow, positionSize.width, positionSize.height );
}
}
if ( handler && handler->mWindow && ignoreTransformEvent->win == handler->mEcoreWindow )
{
- DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform\n", handler->mEcoreWindow );
-
ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
if( wlSurface )
{
- int orientation = wlSurface->OutputTransformed();
+ wlSurface->OutputTransformed();
+
+ bool forceUpdate = false;
+ int orientation = wlSurface->GetOrientation();
+
+ // If PreRotation is supported, don't work client rotation by core.
+ // Client rotation means both window resize and camera rotation.
+ if( wlSurface->IsPreRotationSupported() )
+ {
+ forceUpdate = true;
+ orientation = 0;
+ }
PositionSize positionSize = wlSurface->GetPositionSize();
- handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation );
+ handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation, forceUpdate );
handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+
+ DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform [%d, %d]\n", handler->mEcoreWindow, positionSize.width, positionSize.height );
}
}
void Window::RotationDone( int orientation, int width, int height )
{
+ bool forceUpdate = false;
ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
if( wlSurface )
{
wlSurface->RequestRotation( orientation, width, height );
+
+ // Update orientation
+ orientation = wlSurface->GetOrientation();
+
+ // If PreRotation is supported, don't work client rotation by core.
+ // Client rotation means both window resize and camera rotation.
+ if( wlSurface->IsPreRotationSupported() )
+ {
+ forceUpdate = true;
+ orientation = 0;
+ }
}
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ), orientation, forceUpdate );
// Emit signal
mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
mSurface->MoveResize( positionSize );
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ int orientation = 0;
+ bool forceUpdate = false;
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+ if( wlSurface )
+ {
+ orientation = wlSurface->GetOrientation();
+ // If PreRotation is supported, don't work client rotation by core.
+ // Client rotation means both window resize and camera rotation.
+ if( wlSurface->IsPreRotationSupported() )
+ {
+ forceUpdate = true;
+ orientation = 0;
+ }
+ }
+
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), orientation, forceUpdate );
// Emit signal
mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle );
}
-int WindowRenderSurface::OutputTransformed()
+void WindowRenderSurface::OutputTransformed()
{
int transform;
mScreenRotationAngle = transform * 90;
mScreenRotationFinished = false;
mResizeFinished = false;
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: called!\n" );
}
+
DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::OutputTransformed: angle = %d screen rotation = %d\n", mRotationAngle, mScreenRotationAngle );
- return (mRotationAngle + mScreenRotationAngle) % 360;
}
void WindowRenderSurface::SetTransparency( bool transparent )
ecore_wl_window_alpha_set( mWlWindow, transparent );
}
+int WindowRenderSurface::GetOrientation() const
+{
+ return (mRotationAngle + mScreenRotationAngle) % 360;
+}
+
+bool WindowRenderSurface::IsPreRotationSupported() const
+{
+ return mRotationSupported;
+}
+
void WindowRenderSurface::InitializeEgl( EglInterface& eglIf )
{
DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
mScreenRotationAngle = transform * 90;
mScreenRotationFinished = false;
+
+ DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateWlRenderable: screen rotation = %d\n", mScreenRotationAngle );
}
}
/**
* Notify output is transformed.
*/
- int OutputTransformed();
+ void OutputTransformed();
/**
* @brief Sets whether the surface is transparent or not.
public: // from Dali::RenderSurface
/**
+ * @copydoc Dali::RenderSurface::GetOrientation()
+ */
+ virtual int GetOrientation() const;
+
+ /**
+ * @copydoc Dali::RenderSurface::IsPreRotationSupported()
+ */
+ virtual bool IsPreRotationSupported() const;
+
+ /**
* @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl );
virtual PositionSize GetPositionSize() const;
/**
+ * @copydoc Dali::RenderSurface::GetOrientation()
+ */
+ virtual int GetOrientation() const;
+
+ /**
+ * @copydoc Dali::RenderSurface::IsPreRotationSupported()
+ */
+ virtual bool IsPreRotationSupported() const;
+
+ /**
* @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl ) = 0;
virtual PositionSize GetPositionSize() const;
/**
+ * @copydoc Dali::RenderSurface::GetOrientation()
+ */
+ virtual int GetOrientation() const;
+
+ /**
+ * @copydoc Dali::RenderSurface::IsPreRotationSupported()
+ */
+ virtual bool IsPreRotationSupported() const;
+
+ /**
* @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl );
virtual PositionSize GetPositionSize() const;
/**
+ * @copydoc Dali::RenderSurface::GetOrientation()
+ */
+ virtual int GetOrientation() const;
+
+ /**
+ * @copydoc Dali::RenderSurface::IsPreRotationSupported()
+ */
+ virtual bool IsPreRotationSupported() const;
+
+ /**
* @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl ) = 0;
return mImpl->mPosition;
}
+int NativeRenderSurface::GetOrientation() const
+{
+ return 0;
+}
+
+bool NativeRenderSurface::IsPreRotationSupported() const
+{
+ return false;
+}
+
void NativeRenderSurface::MoveResize( Dali::PositionSize positionSize )
{
}
return mWindow.mPosition;
}
+int RenderSurface::GetOrientation() const
+{
+ return 0;
+}
+
+bool RenderSurface::IsPreRotationSupported() const
+{
+ return false;
+}
+
void RenderSurface::InitializeEgl( EglInterface& egl )
{
Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
virtual PositionSize GetPositionSize() const;
/**
+ * @copydoc Dali::RenderSurface::GetOrientation()
+ */
+ virtual int GetOrientation() const;
+
+ /**
+ * @copydoc Dali::RenderSurface::IsPreRotationSupported()
+ */
+ virtual bool IsPreRotationSupported() const;
+
+ /**
* @copydoc Dali::RenderSurface::InitializeEgl()
*/
virtual void InitializeEgl( EglInterface& egl );
mSurface->MoveResize( positionSize );
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), 0, false );
// Emit signal
mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
return mPosition;
}
+int EcoreXRenderSurface::GetOrientation() const
+{
+ return 0;
+}
+
+bool EcoreXRenderSurface::IsPreRotationSupported() const
+{
+ return false;
+}
+
void EcoreXRenderSurface::MoveResize( Dali::PositionSize positionSize )
{
// nothing to do in base class
ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
ECORE_X_ATOM_CARDINAL, 32, &angles, 2 );
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ), 0, false );
// Emit signal
mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
mSurface->MoveResize( positionSize );
- mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+ mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ), 0, false );
// Emit signal
mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
Integration::StencilBufferAvailable::TRUE );
mCore->ContextCreated();
- mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
+ mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight, 0, false );
mCore->SetDpi( mDpi.x, mDpi.y );
Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
mSurfaceWidth = width;
mSurfaceHeight = height;
- mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
+ mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight, 0, false );
}
void TestApplication::SetTopMargin( unsigned int margin )