X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-render-surface.cpp;h=5258aaeb08d1389f83b34bbf6252109d0f54f9b7;hb=85495083ed69849f52ee7563e91e9ff96312975a;hp=f9eb552deb52e292954eda35c941efcf883a3733;hpb=c6c3a0e33492b5a7753072cf20505f0c44a22e49;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index f9eb552..5258aae 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -32,6 +32,7 @@ #include #include #include +#include namespace Dali @@ -114,6 +115,7 @@ void WindowRenderSurface::Initialize( Any surface ) if( mScreenRotationAngle != 0 ) { mScreenRotationFinished = false; + mResizeFinished = false; } } @@ -144,12 +146,6 @@ void WindowRenderSurface::SetTransparency( bool transparent ) void WindowRenderSurface::RequestRotation( int angle, int width, int height ) { - if( !mRotationSupported ) - { - DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::Rotate: Rotation is not supported!\n" ); - return; - } - if( !mRotationTrigger ) { TriggerEventFactoryInterface& triggerFactory = Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetTriggerEventFactoryInterface(); @@ -184,7 +180,21 @@ PositionSize WindowRenderSurface::GetPositionSize() const void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { - mWindowBase->GetDpi( dpiHorizontal, dpiVertical ); + const char* environmentDpiHorizontal = std::getenv( DALI_ENV_DPI_HORIZONTAL ); + dpiHorizontal = environmentDpiHorizontal ? std::atoi( environmentDpiHorizontal ) : 0; + + const char* environmentDpiVertical = std::getenv( DALI_ENV_DPI_VERTICAL ); + dpiVertical = environmentDpiVertical ? std::atoi( environmentDpiVertical ) : 0; + + if( dpiHorizontal == 0 || dpiVertical == 0 ) + { + mWindowBase->GetDpi( dpiHorizontal, dpiVertical ); + } +} + +int WindowRenderSurface::GetOrientation() const +{ + return mWindowBase->GetOrientation(); } void WindowRenderSurface::InitializeGraphics() @@ -234,7 +244,10 @@ void WindowRenderSurface::CreateSurface() // Check rotation capability mRotationSupported = mWindowBase->IsEglWindowRotationSupported(); - DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::CreateSurface: w = %d h = %d angle = %d screen rotation = %d\n", mPositionSize.width, mPositionSize.height, mRotationAngle, mScreenRotationAngle ); + int screenWidth, screenHeight; + WindowSystem::GetScreenSize( screenWidth, screenHeight ); + DALI_LOG_RELEASE_INFO("WindowRenderSurface::CreateSurface: w = %d h = %d screenWidth = %d screenHeight = %d angle = %d screen rotation = %d\n", + mPositionSize.width, mPositionSize.height, screenWidth, screenHeight, mRotationAngle, mScreenRotationAngle ); } void WindowRenderSurface::DestroySurface() @@ -336,11 +349,11 @@ bool WindowRenderSurface::PreRender( bool resizingSurface ) if( resizingSurface ) { + int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360; + // Window rotate or screen rotate if( !mRotationFinished || !mScreenRotationFinished ) { - int totalAngle = (mRotationAngle + mScreenRotationAngle) % 360; - mWindowBase->SetEglWindowRotation( totalAngle ); mWindowBase->SetEglWindowBufferTransform( totalAngle ); @@ -357,9 +370,23 @@ bool WindowRenderSurface::PreRender( bool resizingSurface ) } // Resize case - if( !mResizeFinished ) + if ( !mResizeFinished ) { - mWindowBase->ResizeEglWindow( mPositionSize ); + Dali::PositionSize positionSize; + positionSize.x = mPositionSize.x; + positionSize.y = mPositionSize.y; + if( totalAngle == 0 || totalAngle == 180 ) + { + positionSize.width = mPositionSize.width; + positionSize.height = mPositionSize.height; + } + else + { + positionSize.width = mPositionSize.height; + positionSize.height = mPositionSize.width; + } + + mWindowBase->ResizeEglWindow( positionSize ); mResizeFinished = true; DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::PreRender: Set resize\n" ); @@ -416,12 +443,6 @@ void WindowRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, b { mRenderNotification->Trigger(); } - - if ( eglImpl.IsSurfacelessContextSupported() ) - { - // Switch to the shared context after rendering this surface - eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() ); - } } } @@ -472,6 +493,7 @@ void WindowRenderSurface::OutputTransformed() { mScreenRotationAngle = screenRotationAngle; mScreenRotationFinished = false; + mResizeFinished = false; mOutputTransformedSignal.Emit();