There are pre-defined Mobile DPI values in
EflScreenUtilitis.cpp as follows:
static const int lowDefaultMobileDPI = 120;
static const int mediumDefaultMobileDPI = 160;
static const int highDefaultMobileDPI = 240;
static const int extrahighDefaultMobileDPI = 320;
One of the values are selected by the logic with the DPI value
returned by X-Window or wayland. However, this does not work properly
with desktop monitors.
Instead of using mobile DPI values, we use the raw DPI value for the
VGA screen and set the custom device scale factor to 1 for the HD screen.
We also need a logic to choose a proper DPI value for various screen
types.
Change-Id: I9e3c875a864865edb4f5163fa289da6f931a1dd3
impl->pageProxy->initializeWebPage();
-#if ENABLE(TIZEN_VIEWPORT_META_TAG)
+#if ENABLE(TIZEN_VIEWPORT_META_TAG) && !ENABLE(TIZEN_DESKTOP_BROWSING)
impl->pageProxy->setCustomDeviceScaleFactor((float)getMobileDPI() / 160);
#else
- impl->pageProxy->setCustomDeviceScaleFactor((float)getDPI() / 160);
+ int dpi = getDPI();
+ if (dpi == 188) // This is for the HD screen.
+ impl->pageProxy->setCustomDeviceScaleFactor(1.0);
+ else // This is for the VGA screen(75 dpi).
+ impl->pageProxy->setCustomDeviceScaleFactor((float)dpi / 160);
#endif
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE) && !ENABLE(TIZEN_WEBKIT2_EFL_WTR)