From ad4898808c2dc87aeb6c3338872529c05f27d73d Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 12 Aug 2019 13:42:01 +0900 Subject: [PATCH] [Tizen] Add environment variable to manually set DPI This reverts commit 76607615939052a7499cab00382b2f3019ac37f9. Change-Id: I5dfc897e95ffa8897e24ec41cf3decc3563dca16 --- dali/internal/system/common/environment-variables.h | 4 ++++ dali/internal/window-system/common/window-render-surface.cpp | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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..bd335f6 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -184,7 +184,16 @@ PositionSize WindowRenderSurface::GetPositionSize() const void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { - mWindowBase->GetDpi( dpiHorizontal, dpiVertical ); + const char* environmentDpiX = std::getenv("DALI_ENV_DPI_HORIZONTAL"); + dpiHorizontal = environmentDpiX ? std::atoi(environmentDpiX) : 0; + + const char* environmentDpiY = std::getenv("DALI_ENV_DPI_VERTICAL"); + dpiVertical = environmentDpiY ? std::atoi(environmentDpiY) : 0; + + if( dpiHorizontal == 0 || dpiVertical == 0 ) + { + mWindowBase->GetDpi( dpiHorizontal, dpiVertical ); + } } void WindowRenderSurface::InitializeGraphics() -- 2.7.4