XWalk WebView patchset, README and LICENSE files.
[platform/framework/web/xwalk_webview.git] / patchset / 0032-Obviate-device-scale-factor-problem.patch
1 From e0a14f54cc9874faa19b1fbe930e2c40ee044055 Mon Sep 17 00:00:00 2001
2 From: Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
3 Date: Tue, 10 Sep 2013 13:30:41 +0300
4 Subject: [PATCH 32/33] Obviate device scale factor problem.
5
6 ---
7  content/browser/renderer_host/window_utils_efl.cc | 33 +++--------------------
8  1 file changed, 3 insertions(+), 30 deletions(-)
9
10 diff --git a/content/browser/renderer_host/window_utils_efl.cc b/content/browser/renderer_host/window_utils_efl.cc
11 index 2834d59..95caa4e 100644
12 --- a/content/browser/renderer_host/window_utils_efl.cc
13 +++ b/content/browser/renderer_host/window_utils_efl.cc
14 @@ -6,44 +6,17 @@
15  
16  #include "ui/gfx/rect.h"
17  #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h"
18 +#include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFactory.h"
19  
20  #include <Ecore_X.h>
21  
22  namespace content {
23  
24 -namespace {
25 -
26 -// Length of an inch in CSS's 1px unit.
27 -const int kPixelsPerInch = 96;
28 -
29 -int depthPerComponent(int depth) {
30 -    switch (depth) {
31 -    case 0:
32 -    case 24:
33 -    case 32:
34 -        return 8;
35 -    case 8:
36 -        return 2;
37 -    default:
38 -        return depth / 3;
39 -    }
40 -}
41 -
42 -}
43 -
44  void GetScreenInfoEfl(WebKit::WebScreenInfo* results) {
45    Ecore_X_Display* display = ecore_x_display_get();
46    Ecore_X_Screen* screen = ecore_x_default_screen_get();
47 -  int width, height;
48 -  ecore_x_screen_size_get(screen, &width, &height);
49 -  int depth = ecore_x_default_depth_get(display, screen);
50 -  results->deviceScaleFactor = ecore_x_dpi_get() / kPixelsPerInch;
51 -  results->isMonochrome = depth == 1;
52 -  results->depth = depth;
53 -  results->depthPerComponent = depthPerComponent(depth);
54 -  // FIXME: not sure how to get available rect.
55 -  results->rect = WebKit::WebRect(0, 0, width, height);
56 -  results->availableRect = results->rect;
57 +  *results = WebKit::WebScreenInfoFactory::screenInfo(
58 +      reinterpret_cast<Display*>(display), ecore_x_screen_index_get(screen));
59  }
60  
61  } // namespace content
62 -- 
63 1.8.1.2
64