[EFL] Move function to get dpi to the WebCore/platform/efl/EflScreenUtilities.cpp.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jan 2012 06:46:45 +0000 (06:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jan 2012 06:46:45 +0000 (06:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75292

Patch by Eunmi Lee <eunmi15.lee@samsung.com> on 2012-01-01
Reviewed by Andreas Kling.

Move ewk_util_dpi_get() function in the ewk_util.cpp to the
WebCore/platform/efl/EflScreenUtilities.cpp in order to use it in the WebKit2.
The function's name is changed to getDPI().

Source/WebCore:

* PlatformEfl.cmake:
* platform/efl/EflScreenUtilities.cpp: Added.
(WebCore::getDPI):
* platform/efl/EflScreenUtilities.h: Added.

Source/WebKit/efl:

* ewk/ewk_private.h:
* ewk/ewk_util.cpp:
(ewk_util_image_from_cairo_surface_add):
* ewk/ewk_view.cpp:
(_ewk_view_viewport_attributes_compute):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103891 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/platform/efl/EflScreenUtilities.cpp [new file with mode: 0644]
Source/WebCore/platform/efl/EflScreenUtilities.h [new file with mode: 0644]
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_private.h
Source/WebKit/efl/ewk/ewk_util.cpp
Source/WebKit/efl/ewk/ewk_view.cpp

index e2cc1c9..229df13 100644 (file)
@@ -1,3 +1,19 @@
+2012-01-01  Eunmi Lee  <eunmi15.lee@samsung.com>
+
+        [EFL] Move function to get dpi to the WebCore/platform/efl/EflScreenUtilities.cpp.
+        https://bugs.webkit.org/show_bug.cgi?id=75292
+
+        Reviewed by Andreas Kling.
+
+        Move ewk_util_dpi_get() function in the ewk_util.cpp to the
+        WebCore/platform/efl/EflScreenUtilities.cpp in order to use it in the WebKit2.
+        The function's name is changed to getDPI().
+
+        * PlatformEfl.cmake:
+        * platform/efl/EflScreenUtilities.cpp: Added.
+        (WebCore::getDPI):
+        * platform/efl/EflScreenUtilities.h: Added.
+
 2012-01-01  Andreas Kling  <awesomekling@apple.com>
 
         Merge CollectionCache into HTMLCollection.
index bc235d7..49070b9 100644 (file)
@@ -28,6 +28,7 @@ LIST(APPEND WebCore_SOURCES
   platform/efl/DragDataEfl.cpp
   platform/efl/DragImageEfl.cpp
   platform/efl/EflKeyboardUtilities.cpp
+  platform/efl/EflScreenUtilities.cpp
   platform/efl/EventLoopEfl.cpp
   platform/efl/FileSystemEfl.cpp
   platform/efl/KURLEfl.cpp
diff --git a/Source/WebCore/platform/efl/EflScreenUtilities.cpp b/Source/WebCore/platform/efl/EflScreenUtilities.cpp
new file mode 100644 (file)
index 0000000..12d23ff
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "EflScreenUtilities.h"
+
+#ifdef HAVE_ECORE_X
+#include <Ecore_X.h>
+#endif
+
+namespace WebCore {
+
+int getDPI()
+{
+#ifdef HAVE_ECORE_X
+    return ecore_x_dpi_get();
+#else
+    return 160;
+#endif
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/efl/EflScreenUtilities.h b/Source/WebCore/platform/efl/EflScreenUtilities.h
new file mode 100644 (file)
index 0000000..e92aee2
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef EflScreenUtilities_h
+#define EflScreenUtilities_h
+
+namespace WebCore {
+
+int getDPI();
+
+} // namespace WebCore
+
+#endif // EflScreenUtilities_h
index 164826a..8f7258b 100644 (file)
@@ -1,3 +1,20 @@
+2012-01-01  Eunmi Lee  <eunmi15.lee@samsung.com>
+
+        [EFL] Move function to get dpi to the WebCore/platform/efl/EflScreenUtilities.cpp.
+        https://bugs.webkit.org/show_bug.cgi?id=75292
+
+        Reviewed by Andreas Kling.
+
+        Move ewk_util_dpi_get() function in the ewk_util.cpp to the
+        WebCore/platform/efl/EflScreenUtilities.cpp in order to use it in the WebKit2.
+        The function's name is changed to getDPI().
+
+        * ewk/ewk_private.h:
+        * ewk/ewk_util.cpp:
+        (ewk_util_image_from_cairo_surface_add):
+        * ewk/ewk_view.cpp:
+        (_ewk_view_viewport_attributes_compute):
+
 2011-12-27  JungJik Lee  <jungjik.lee@samsung.com>
 
         [EFL] Remove duplicate code and remove entry after freeing the matrix.
index 4ce0fef..a5307f0 100644 (file)
@@ -153,8 +153,6 @@ void ewk_view_frame_view_creation_notify(Evas_Object* ewkView);
 void ewk_view_js_window_object_clear(Evas_Object* ewkView, Evas_Object* frame);
 #endif
 
-int ewk_util_dpi_get();
-
 #if ENABLE(TOUCH_EVENTS)
 void ewk_view_need_touch_events_set(Evas_Object*, bool needed);
 bool ewk_view_need_touch_events_get(const Evas_Object*);
index 3a0ab4d..749b038 100644 (file)
 #include "ewk_private.h"
 #include <eina_safety_checks.h>
 
-#ifdef HAVE_ECORE_X
-#include <Ecore_X.h>
-#endif
-
 /**
  * Converts an image from cairo_surface to the Evas_Object.
  *
@@ -108,18 +104,3 @@ Evas_Object* ewk_util_image_from_cairo_surface_add(Evas* canvas, cairo_surface_t
 
     return image;
 }
-
-/**
- * @internal
- * Gets dpi value.
- *
- * @return device's dpi value.
- */
-int ewk_util_dpi_get()
-{
-#ifdef HAVE_ECORE_X
-    return ecore_x_dpi_get();
-#else
-    return 160;
-#endif
-}
index 712db76..28e9f0b 100644 (file)
@@ -30,6 +30,7 @@
 #include "DocumentLoader.h"
 #include "DragClientEfl.h"
 #include "EditorClientEfl.h"
+#include "EflScreenUtilities.h"
 #include "EventHandler.h"
 #include "FocusController.h"
 #include "FrameLoaderClientEfl.h"
@@ -1084,7 +1085,7 @@ static void _ewk_view_zoom_animation_start(Ewk_View_Smart_Data* smartData)
 static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(const Ewk_View_Private_Data* priv)
 {
     int desktopWidth = 980;
-    int deviceDPI = ewk_util_dpi_get();
+    int deviceDPI = WebCore::getDPI();
 
     WebCore::IntRect availableRect = enclosingIntRect(priv->page->chrome()->client()->pageRect());
     WebCore::IntRect deviceRect = enclosingIntRect(priv->page->chrome()->client()->windowRect());