Do not use the mobile DPI values. 97/10097/1
authorJoone Hur <joone.hur@intel.com>
Tue, 17 Sep 2013 01:34:13 +0000 (18:34 -0700)
committerJoone Hur <joone.hur@intel.com>
Wed, 18 Sep 2013 00:30:16 +0000 (17:30 -0700)
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

Source/WebKit2/UIProcess/API/efl/ewk_view.cpp

index f7db75f..82d241e 100644 (file)
@@ -1191,10 +1191,14 @@ static void _ewk_view_initialize(Evas_Object* ewkView, PassRefPtr<Ewk_Context> c
 
     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)