X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-render-surface.cpp;h=8bb94c526fe6c180c05035b228eda9346d0898e1;hb=05f371f0329cf6cf10409e74770b0a875bf49a1b;hp=18ae128db90073f52f5d758b61f85a694d546565;hpb=aea5f2061bbea02a524375897ddcd33e9730df96;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 18ae128..8bb94c5 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 @@ -71,7 +72,9 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, Any s mRotationSupported( false ), mRotationFinished( true ), mScreenRotationFinished( true ), - mResizeFinished( true ) + mResizeFinished( true ), + mDpiHorizontal( 0 ), + mDpiVertical( 0 ) { DALI_LOG_INFO( gWindowRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" ); Initialize( surface ); @@ -83,6 +86,11 @@ WindowRenderSurface::~WindowRenderSurface() { delete mRotationTrigger; } + + if ( mEGLSurface ) + { + DestroySurface(); + } } void WindowRenderSurface::Initialize( Any surface ) @@ -179,7 +187,22 @@ PositionSize WindowRenderSurface::GetPositionSize() const void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { - mWindowBase->GetDpi( dpiHorizontal, dpiVertical ); + if( mDpiHorizontal == 0 || mDpiVertical == 0 ) + { + const char* environmentDpiHorizontal = std::getenv( DALI_ENV_DPI_HORIZONTAL ); + mDpiHorizontal = environmentDpiHorizontal ? std::atoi( environmentDpiHorizontal ) : 0; + + const char* environmentDpiVertical = std::getenv( DALI_ENV_DPI_VERTICAL ); + mDpiVertical = environmentDpiVertical ? std::atoi( environmentDpiVertical ) : 0; + + if( mDpiHorizontal == 0 || mDpiVertical == 0 ) + { + mWindowBase->GetDpi( mDpiHorizontal, mDpiVertical ); + } + } + + dpiHorizontal = mDpiHorizontal; + dpiVertical = mDpiVertical; } void WindowRenderSurface::InitializeGraphics() @@ -229,7 +252,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() @@ -411,12 +437,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() ); - } } }