Apply screen rotation to create window.
Current solution is to use output transform event.
It has one problem which the not rotated scene is shown when output transform event is received too late.
To fix the problem, window(scene) should be create with screen rotation angle.
Change-Id: If59d2d94f5a5b22d291354539804bd50a7b1ef42
// Create the scene
PositionSize surfacePositionSize = mSurface->GetPositionSize();
// Create the scene
PositionSize surfacePositionSize = mSurface->GetPositionSize();
- mScene = Dali::Integration::Scene::New( Size(static_cast<float>( surfacePositionSize.width ), static_cast<float>( surfacePositionSize.height )) );
+ int orientation = mSurface->GetOrientation();
+ mScene = Dali::Integration::Scene::New( Size(static_cast<float>( surfacePositionSize.width ), static_cast<float>( surfacePositionSize.height )), orientation );
Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation( adaptor );
mAdaptor = &adaptorImpl;
Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation( adaptor );
mAdaptor = &adaptorImpl;
mRotationFinished( true ),
mScreenRotationFinished( true ),
mResizeFinished( true ),
mRotationFinished( true ),
mScreenRotationFinished( true ),
mResizeFinished( true ),
+ mDefaultScreenRotationAvailable( false ),
mDpiHorizontal( 0 ),
mDpiVertical( 0 )
{
mDpiHorizontal( 0 ),
mDpiVertical( 0 )
{
// Connect signals
mWindowBase->OutputTransformedSignal().Connect( this, &WindowRenderSurface::OutputTransformed );
// Connect signals
mWindowBase->OutputTransformedSignal().Connect( this, &WindowRenderSurface::OutputTransformed );
+
+ // Check screen rotation
+ mScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
+ if( mScreenRotationAngle != 0 )
+ {
+ mScreenRotationFinished = false;
+ mResizeFinished = false;
+ mDefaultScreenRotationAvailable = true;
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::Initialize, screen rotation is enabled, screen rotation angle:[%d]\n", mScreenRotationAngle );
+ }
}
Any WindowRenderSurface::GetNativeWindow()
}
Any WindowRenderSurface::GetNativeWindow()
{
DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter );
{
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;
+ }
+
- EGLNativeWindowType window = mWindowBase->CreateEglWindow( mPositionSize.width, mPositionSize.height );
+ EGLNativeWindowType window = mWindowBase->CreateEglWindow( width, height );
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+ if( resizingSurface || mDefaultScreenRotationAvailable )
{
int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360;
{
int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360;
// Reset only screen rotation flag
mScreenRotationFinished = true;
// Reset only screen rotation flag
mScreenRotationFinished = true;
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set rotation [%d] [%d]\n", mRotationAngle, mScreenRotationAngle );
+ DALI_LOG_RELEASE_INFO( "WindowRenderSurface::PreRender: Set rotation [%d] [%d]\n", mRotationAngle, mScreenRotationAngle );
mWindowBase->ResizeEglWindow( positionSize );
mResizeFinished = true;
mWindowBase->ResizeEglWindow( positionSize );
mResizeFinished = true;
- DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" );
+ DALI_LOG_RELEASE_INFO( "WindowRenderSurface::PreRender: Set resize\n" );
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.SetFullSwapNextFrame();
}
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
eglImpl.SetFullSwapNextFrame();
}
+ mDefaultScreenRotationAvailable = false;
bool mRotationFinished;
bool mScreenRotationFinished;
bool mResizeFinished;
bool mRotationFinished;
bool mScreenRotationFinished;
bool mResizeFinished;
+ bool mDefaultScreenRotationAvailable;
uint32_t mDpiHorizontal;
uint32_t mDpiVertical;
uint32_t mDpiHorizontal;
uint32_t mDpiVertical;