[Tizen] Add environment variable to manually set DPI
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 5 Aug 2019 04:50:39 +0000 (13:50 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 5 Aug 2019 04:50:51 +0000 (13:50 +0900)
This reverts commit 45013b4f6229e319c05ff314f36ae3594289b2c1.

Change-Id: I2cc853c6c8ad92eb5868c763ad568624a425a009

dali/internal/system/common/environment-variables.h
dali/internal/window-system/common/window-render-surface.cpp

index 0947bdb..3d63c00 100644 (file)
@@ -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
index 3a316f8..bd335f6 100644 (file)
@@ -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()