From: Seungho, Baek Date: Wed, 31 Jul 2019 05:22:19 +0000 (+0900) Subject: Add environment variable to manually set DPI X-Git-Tag: dali_1.4.34~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=05f371f0329cf6cf10409e74770b0a875bf49a1b Add environment variable to manually set DPI Change-Id: I81286041aa2f3b3cf0c89332f768eee3459c8af9 Signed-off-by: Seungho, Baek --- diff --git a/dali/internal/system/common/environment-variables.h b/dali/internal/system/common/environment-variables.h index 0947bdb..3d63c00 100644 --- a/dali/internal/system/common/environment-variables.h +++ b/dali/internal/system/common/environment-variables.h @@ -118,6 +118,10 @@ namespace Adaptor #define DALI_ENV_WEB_ENGINE_NAME "DALI_WEB_ENGINE_NAME" +#define DALI_ENV_DPI_HORIZONTAL "DALI_DPI_HORIZONTAL" + +#define DALI_ENV_DPI_VERTICAL "DALI_DPI_VERTICAL" + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index 3a316f8..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 ); @@ -184,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() diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index 55bc955..8749342 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -251,6 +251,9 @@ private: // Data bool mScreenRotationFinished; bool mResizeFinished; + uint32_t mDpiHorizontal; + uint32_t mDpiVertical; + }; // class WindowRenderSurface } // namespace Adaptor